me
/
guix
Archived
1
0
Fork 0

bash completion: Fix ‘system’ & ‘container’ subcommands.

* etc/completion/bash/guix (_guix_complete): Count words from the
innermost command.
master
Tobias Geerinckx-Rice 2021-10-03 14:47:44 +02:00
parent d71cfaea30
commit ed14bc2984
No known key found for this signature in database
GPG Key ID: 0DB0FF884F556D79
1 changed files with 5 additions and 5 deletions

View File

@ -284,8 +284,8 @@ _guix_complete ()
_guix_complete_available_package_or_store_file "$word_at_point" _guix_complete_available_package_or_store_file "$word_at_point"
elif [[ "$command" = "system" ]] elif [[ "$command" = "system" ]]
then then
case $COMP_CWORD in case $((COMP_CWORD - command_index)) in
2) _guix_complete_subcommand;; 1) _guix_complete_subcommand;;
*) _guix_complete_file;; # TODO: restrict to *.scm *) _guix_complete_file;; # TODO: restrict to *.scm
esac esac
elif [[ "$command" = "pull" ]] elif [[ "$command" = "pull" ]]
@ -304,9 +304,9 @@ _guix_complete ()
fi fi
elif [[ "$command" = "container" ]] elif [[ "$command" = "container" ]]
then then
case $COMP_CWORD in case $((COMP_CWORD - command_index)) in
2) _guix_complete_subcommand;; 1) _guix_complete_subcommand;;
3) _guix_complete_pid "$word_at_point";; 2) _guix_complete_pid "$word_at_point";;
*) _guix_complete_file;; *) _guix_complete_file;;
esac esac
elif [[ "$command" = "import" ]] elif [[ "$command" = "import" ]]