Skip to main content
Improved formatting, grammar, and punctuation.
Source Link

I'm using SaltStack. I would like to auto-complete the minion name when calling the salt command.

Then typing salt in<tab>inTab --> salt integration-<tab>Tab,; I can see it works as expected:

$ salt integration-
integration-c   integration-u   integration-u2
$ salt integration-TabTab
integration-c   integration-u   integration-u2

To use with sudo, I have added complete -cf sudo into ~/.bashrc, but it didn't work: sudo salt in<tab returned nothing.

    sudo salt inTab
returned nothing.

UPDATE Sat Jul 12 08:51:23 ICT 2014Update

Oh, the first thing I would like to say is sometimesometimes it works:

$ sudo salt integration-
integration-c   integration-u   integration-u2 
$ sudo salt integration-TabTab
integration-c   integration-u   integration-u2

sometimeand sometimes it doesn't.

 

if you type sudo sudo mkdir <tab><tab>TabTab, does does it show a list of directories directories?

$ sudo mkdir 
.FontForge/        .djangopypi2/      .ievms/            .ssh/              .wireshark-etc/
$ sudo mkdir TabTab
.FontForge/        .djangopypi2/      .ievms/            .ssh/              .wireshark-etc/

I'm using SaltStack. I would like to auto-complete the minion name when calling salt command.

Then typing salt in<tab> --> salt integration-<tab>, I can see it works as expected:

$ salt integration-
integration-c   integration-u   integration-u2

To use with sudo, I have added complete -cf sudo into ~/.bashrc, but it didn't work: sudo salt in<tab returned nothing.

UPDATE Sat Jul 12 08:51:23 ICT 2014

Oh, the first thing I would like to say is sometime it works:

$ sudo salt integration-
integration-c   integration-u   integration-u2 

sometime it doesn't.

if you type sudo mkdir <tab><tab>, does it show a list of directories?

$ sudo mkdir 
.FontForge/        .djangopypi2/      .ievms/            .ssh/              .wireshark-etc/

I'm using SaltStack. I would like to auto-complete the minion name when calling the salt command.

Then typing salt inTab salt integration-Tab; I can see it works as expected:

$ salt integration-TabTab
integration-c   integration-u   integration-u2

To use with sudo, I have added complete -cf sudo into ~/.bashrc, but it didn't work:

    sudo salt inTab
returned nothing.

Update

Oh, the first thing I would like to say is sometimes it works:

$ sudo salt integration-TabTab
integration-c   integration-u   integration-u2

and sometimes it doesn't.

 

if you type sudo mkdir TabTab, does it show a list of directories?

$ sudo mkdir TabTab
.FontForge/        .djangopypi2/      .ievms/            .ssh/              .wireshark-etc/
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot
tag osx added
Link
Braiam
  • 36.9k
  • 29
  • 114
  • 176

osx - bash does not autocomplete my command when using sudo?

added 4298 characters in body
Source Link
quanta
  • 1.7k
  • 1
  • 14
  • 25
Loading
Tweeted twitter.com/#!/StackUnix/status/487107824674414592
Notice added Authoritative reference needed by quanta
Bounty Started worth 50 reputation by quanta
Source Link
quanta
  • 1.7k
  • 1
  • 14
  • 25
Loading