New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible complete #4697

Merged
merged 9 commits into from Feb 6, 2018

Conversation

Projects
None yet
3 participants
@hamon-e
Copy link
Contributor

hamon-e commented Feb 1, 2018

@faho
Copy link
Member

faho left a comment

  • Split into one file per command

  • Shorter descriptions

  • More arguments

  • Use fish's functions

  • Cosmetics

@@ -0,0 +1,106 @@
# fish 2.2.0 does not include native snippet support. Upgrade to fish >= 2.3.0

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

This comment is unnecessary, since this won't be available in fish 2.2.0.

# ansible
complete -c ansible -s a -l args -r -f -d "module arguments"
complete -c ansible -l ask-vault-pass -f -d "ask for vault password"
complete -c ansible -s B -l background -r -f -d "run asynchronously, failing after X seconds (default=N/A)"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

"failing after X seconds" - does that mean that this takes an argument? "default=N/A" - can that argument be the string "N/A"?

complete -c ansible -s a -l args -r -f -d "module arguments"
complete -c ansible -l ask-vault-pass -f -d "ask for vault password"
complete -c ansible -s B -l background -r -f -d "run asynchronously, failing after X seconds (default=N/A)"
complete -c ansible -s C -l check -f -d "don't make any changes; instead, try to predict some of the changes that may occur"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

This should be a bit shorter. Something like "Just check, don't make any changes"?

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

(Thats a general thing - descriptions should be short, so we can fit more on a screen)

complete -c ansible -l ask-vault-pass -f -d "ask for vault password"
complete -c ansible -s B -l background -r -f -d "run asynchronously, failing after X seconds (default=N/A)"
complete -c ansible -s C -l check -f -d "don't make any changes; instead, try to predict some of the changes that may occur"
complete -c ansible -s D -l diff -f -d "when changing (small) files and templates, show the differences in those files; works great with --check"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

"Show the difference in changed files/templates"?

# source $file
# end
# ansible
complete -c ansible -s a -l args -r -f -d "module arguments"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

We capitalize the first word of the description - "Module arguments".

complete -c ansible -s k -l ask-pass -f -d "ask for connection password"
complete -c ansible -l private-key -r -d "use this file to authenticate the connection"
complete -c ansible -l key-file -r -d "use this file to authenticate the connection"
complete -c ansible -s u -l user -f -d "connect as this user (default=None)"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

We have __fish_complete_users, which can at least do local users.

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

(Also goes for other things that may take users)

complete -c ansible -s s -l sudo -f -d "run operations with sudo (nopasswd) (deprecated, use become)"
complete -c ansible -s U -l sudo-user -r -f -d "desired sudo user (default=root) (deprecated, use become)"
complete -c ansible -s S -l su -f -d "run operations with su (deprecated, use become)"
complete -c ansible -s R -l su-user -r -f -d "run operations with su as this user (default=root) (deprecated, use become)"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

Remove the deprecated options - we want to steer users towards using those that will still be available in future.

complete -c ansible -s S -l su -f -d "run operations with su (deprecated, use become)"
complete -c ansible -s R -l su-user -r -f -d "run operations with su as this user (default=root) (deprecated, use become)"
complete -c ansible -s b -l become -f -d "run operations with become (does not imply password prompting)"
complete -c ansible -l become-method -r -f -d "privilege escalation method to use (default=sudo), valid choices: [ sudo | su | pbrun | pfexec | runas | doas | dzdo ]"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

Give the valid choices via -a "sudo su pbrun..." instead of in the description.

complete -c ansible-playbook -l ask-su-pass -f -d "ask for su password (deprecated, use become)"
complete -c ansible-playbook -s K -l ask-become-pass -f -d "ask for privilege escalation password"
# ansible-galaxy
complete -c ansible-galaxy -a "delete import info init install list login remove search setup"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

Again, new file.

complete -c ansible-galaxy -s v -l verbose -d "verbose mode (-vvv for more, -vvvv to enable connection debugging)"
complete -c ansible-galaxy -l version -d "show program's version number and exit"
# ansible-vault
complete -c ansible-vault -l ask-vault-pass -f -d "ask for vault password"

This comment has been minimized.

@faho

faho Feb 1, 2018

Member

New file.

@faho faho added this to the fish-3.0 milestone Feb 1, 2018

@faho

This comment has been minimized.

Copy link
Member

faho commented Feb 1, 2018

Another thing I hadn't checked: Most of these use "-r" or "-f". These didn't quite work as intended up until 2.7.0, so for a while people were adding them left and right.

It should be checked whether all of these are actually correct or necessary.

@faho faho merged commit 54c9d57 into fish-shell:master Feb 6, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@faho

This comment has been minimized.

Copy link
Member

faho commented Feb 6, 2018

Merged, thanks!

@faho faho added the release notes label Feb 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment