@@ -355,22 +355,27 @@ func (t *autoCompleter) Do(line []rune, pos int) (options [][]rune, offset int)
355355 return nil , 0
356356 }
357357
358- autocompleteAPIArgs := []string {"listall=true" }
359- if autocompleteAPI .Noun == "templates" {
360- autocompleteAPIArgs = append (autocompleteAPIArgs , "templatefilter=executable" )
361- }
358+ completeArgs := t .Config .Core .AutoComplete
359+ autocompleteAPIArgs := []string {}
360+ argOptions := []argOption {}
361+ if completeArgs {
362+ autocompleteAPIArgs = []string {"listall=true" }
363+ if autocompleteAPI .Noun == "templates" {
364+ autocompleteAPIArgs = append (autocompleteAPIArgs , "templatefilter=executable" )
365+ }
362366
363- if apiFound .Name != "provisionCertificate" && autocompleteAPI .Name == "listHosts" {
364- autocompleteAPIArgs = append (autocompleteAPIArgs , "type=Routing" )
365- }
367+ if apiFound .Name != "provisionCertificate" && autocompleteAPI .Name == "listHosts" {
368+ autocompleteAPIArgs = append (autocompleteAPIArgs , "type=Routing" )
369+ }
366370
367- spinner := t .Config .StartSpinner ("fetching options, please wait..." )
368- request := cmd .NewRequest (nil , completer .Config , nil )
369- response , _ := cmd .NewAPIRequest (request , autocompleteAPI .Name , autocompleteAPIArgs , false )
370- t .Config .StopSpinner (spinner )
371+ spinner := t .Config .StartSpinner ("fetching options, please wait..." )
372+ request := cmd .NewRequest (nil , completer .Config , nil )
373+ response , _ := cmd .NewAPIRequest (request , autocompleteAPI .Name , autocompleteAPIArgs , false )
374+ t .Config .StopSpinner (spinner )
371375
372- hasID := strings .HasSuffix (arg .Name , "id=" ) || strings .HasSuffix (arg .Name , "ids=" )
373- argOptions := buildArgOptions (response , hasID )
376+ hasID := strings .HasSuffix (arg .Name , "id=" ) || strings .HasSuffix (arg .Name , "ids=" )
377+ argOptions = buildArgOptions (response , hasID )
378+ }
374379
375380 filteredOptions := []argOption {}
376381 if len (argOptions ) > 0 {
0 commit comments