[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/09: bash completion: Properly complete 'guix container exec'.
From: |
Ludovic Courtès |
Subject: |
04/09: bash completion: Properly complete 'guix container exec'. |
Date: |
Mon, 6 Feb 2017 23:08:27 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit a93c1c59218aac49382c35fe23d1e0f021e6e676
Author: Ludovic Courtès <address@hidden>
Date: Mon Feb 6 17:05:34 2017 +0100
bash completion: Properly complete 'guix container exec'.
* etc/completion/bash/guix (_guix_complete_pid): New function.
(_guix_complete): Add case for "container".
---
etc/completion/bash/guix | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 9c851e3..00c3dfa 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -113,6 +113,12 @@ _guix_complete_file ()
COMPREPLY=()
}
+_guix_complete_pid ()
+{
+ local pids="$(cd /proc; echo [0-9]*)"
+ COMPREPLY=($(compgen -W "$pids" -- "$1"))
+}
+
declare _guix_subcommands
_guix_complete ()
@@ -158,6 +164,13 @@ _guix_complete ()
2) _guix_complete_subcommand;;
*) _guix_complete_file;; # TODO: restrict to *.scm
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"
then
_guix_complete_subcommand
- branch master updated (a24fda8 -> a062b6c), Ludovic Courtès, 2017/02/06
- 03/09: bash completion: Complete file names after 'guix system COMMAND'., Ludovic Courtès, 2017/02/06
- 06/09: services: bitlbee: Read the PID file., Ludovic Courtès, 2017/02/06
- 05/09: bash completion: Complete subcommands for the current word., Ludovic Courtès, 2017/02/06
- 02/09: bash completion: Complete 'guix gc' with file names., Ludovic Courtès, 2017/02/06
- 07/09: linux-container: Add 'container-excursion*'., Ludovic Courtès, 2017/02/06
- 01/09: file-systems: Add '%network-configuration-files' and '%network-file-mappings'., Ludovic Courtès, 2017/02/06
- 04/09: bash completion: Properly complete 'guix container exec'.,
Ludovic Courtès <=
- 09/09: services: bitlbee: Run in a container., Ludovic Courtès, 2017/02/06
- 08/09: Add (gnu build shepherd)., Ludovic Courtès, 2017/02/06