From 3a56c97087e06a1c6ab99da8a44073acfc132099 Mon Sep 17 00:00:00 2001 From: exploide Date: Thu, 18 Nov 2021 18:20:22 +0100 Subject: [PATCH] slightly improved ansible-galaxy completions --- share/completions/ansible-galaxy.fish | 32 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/share/completions/ansible-galaxy.fish b/share/completions/ansible-galaxy.fish index d21ac2971..8a2304a02 100644 --- a/share/completions/ansible-galaxy.fish +++ b/share/completions/ansible-galaxy.fish @@ -1,4 +1,28 @@ -complete -c ansible-galaxy -a "delete import info init install list login remove search setup" -complete -c ansible-galaxy -s h -l help -d "Show this help message and exit" -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 "Display version and exit" +# global options +complete -c ansible-galaxy -n __fish_use_subcommand -l version -d "Show version and config" +complete -c ansible-galaxy -s h -l help -d "Show help message" +complete -c ansible-galaxy -n __fish_use_subcommand -s v -l verbose -d "Verbose mode (-vvv for more, -vvvv for connection debugging)" + +# first subcommand +complete -c ansible-galaxy -n __fish_use_subcommand -xa "collection\t'Manage a collection' + role\t'Manage a role'" + +# second subcommand (for collection) +complete -c ansible-galaxy -n '__fish_seen_subcommand_from collection' -a "download\t'Download collections as tarball' + init\t'Initialize new collection with the base structure' + build\t'Build collection artifact that can be published' + publish\t'Publish collection artifact to Ansible Galaxy' + install\t'Install collections' + list\t'Show collections installed' + verify\t'Compare checksums of local and remote collections'" + +# second subcommand (for role) +complete -c ansible-galaxy -n '__fish_seen_subcommand_from role' -a "init\t'Initialize new role with the base structure' + remove\t'Delete roles from roles_path' + delete\t'Removes the role from Galaxy' + list\t'Show roles installed' + search\t'Search the Galaxy database by keywords' + import\t'Import role into a galaxy server' + setup\t'Manage integration between Galaxy and the given source' + info\t'View details about a role' + install\t'Install roles'"