bash completion: Consolidate similar $command ‘if’ branches.
* etc/completion/bash/guix (_guix_complete): Combine the ‘upgrade’ and ‘remove’ commands, as well as ‘download’, ‘gc’, and ‘hash’.
This commit is contained in:
parent
83128c97d4
commit
6fba67df19
1 changed files with 3 additions and 14 deletions
|
@ -237,15 +237,7 @@ _guix_complete ()
|
||||||
else
|
else
|
||||||
_guix_complete_available_package "$word_at_point"
|
_guix_complete_available_package "$word_at_point"
|
||||||
fi
|
fi
|
||||||
elif [[ "$command" = "remove" ]]
|
elif [[ "$command" = "upgrade" || "$command" = "remove" ]]
|
||||||
then
|
|
||||||
if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p
|
|
||||||
then
|
|
||||||
_guix_complete_file
|
|
||||||
else
|
|
||||||
_guix_complete_installed_package "$word_at_point"
|
|
||||||
fi
|
|
||||||
elif [[ "$command" = "upgrade" ]]
|
|
||||||
then
|
then
|
||||||
if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p
|
if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p
|
||||||
then
|
then
|
||||||
|
@ -272,7 +264,7 @@ _guix_complete ()
|
||||||
else
|
else
|
||||||
_guix_complete_available_package "$word_at_point"
|
_guix_complete_available_package "$word_at_point"
|
||||||
fi
|
fi
|
||||||
elif [[ "$command" = "download" ]]
|
elif [[ "$command" = "download" || "$command" = "gc" || "$command" = "hash" ]]
|
||||||
then
|
then
|
||||||
_guix_complete_file
|
_guix_complete_file
|
||||||
elif [[ "$command" = "system" ]]
|
elif [[ "$command" = "system" ]]
|
||||||
|
@ -305,9 +297,6 @@ _guix_complete ()
|
||||||
elif [[ "$command" = "import" ]]
|
elif [[ "$command" = "import" ]]
|
||||||
then
|
then
|
||||||
_guix_complete_subcommand
|
_guix_complete_subcommand
|
||||||
elif [[ "$command" = "hash" || "$command" = "gc" ]]
|
|
||||||
then
|
|
||||||
_guix_complete_file
|
|
||||||
elif [[ "$command" = "weather" ]]
|
elif [[ "$command" = "weather" ]]
|
||||||
then
|
then
|
||||||
if _guix_is_dash_m
|
if _guix_is_dash_m
|
||||||
|
|
Reference in a new issue