me
/
guix
Archived
1
0
Fork 0

bash completion: Properly complete 'guix container exec'.

* etc/completion/bash/guix (_guix_complete_pid): New function.
(_guix_complete): Add case for "container".
master
Ludovic Courtès 2017-02-06 17:05:34 +01:00
parent e109ed3922
commit a93c1c5921
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 13 additions and 0 deletions

View File

@ -113,6 +113,12 @@ _guix_complete_file ()
COMPREPLY=() COMPREPLY=()
} }
_guix_complete_pid ()
{
local pids="$(cd /proc; echo [0-9]*)"
COMPREPLY=($(compgen -W "$pids" -- "$1"))
}
declare _guix_subcommands declare _guix_subcommands
_guix_complete () _guix_complete ()
@ -158,6 +164,13 @@ _guix_complete ()
2) _guix_complete_subcommand;; 2) _guix_complete_subcommand;;
*) _guix_complete_file;; # TODO: restrict to *.scm *) _guix_complete_file;; # TODO: restrict to *.scm
esac esac
elif _guix_is_command "container"
then
case $COMP_CWORD in
2) _guix_complete_subcommand;;
3) _guix_complete_pid "$word_at_point";;
*) _guix_complete_file;;
esac
elif _guix_is_command "import" elif _guix_is_command "import"
then then
_guix_complete_subcommand _guix_complete_subcommand