diff options
| author | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-17 12:05:26 +0300 |
|---|---|---|
| committer | Oleg Pykhalov <go.wigust@gmail.com> | 2018-02-17 22:23:07 +0300 |
| commit | f5f916792c7069a22d95c5b7c68bcf3bbb86e451 (patch) | |
| tree | a6a8652c710b0abcfc538b5d2fd81dee318d4734 /etc | |
| parent | a39aa6839464ce7233d441e1cd807bc8eca1d622 (diff) | |
bash completion: Complete files names after 'guix package -m'.
* etc/completion/bash/guix (_guix_is_dash_m): New function.
(_guix_complete): Add this.
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/completion/bash/guix | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 6b84193dbe0..70430c5c959 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix | |||
| @@ -106,6 +106,15 @@ _guix_is_dash_L () | |||
| 106 | esac } | 106 | esac } |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | _guix_is_dash_m () | ||
| 110 | { | ||
| 111 | [ "${COMP_WORDS[$COMP_CWORD - 1]}" = "-m" ] \ | ||
| 112 | || { case "${COMP_WORDS[$COMP_CWORD]}" in | ||
| 113 | --manifest=*) true;; | ||
| 114 | *) false;; | ||
| 115 | esac } | ||
| 116 | } | ||
| 117 | |||
| 109 | _guix_complete_file () | 118 | _guix_complete_file () |
| 110 | { | 119 | { |
| 111 | # Let Readline complete file names. | 120 | # Let Readline complete file names. |
| @@ -149,7 +158,7 @@ _guix_complete () | |||
| 149 | *) | 158 | *) |
| 150 | if _guix_is_command "package" | 159 | if _guix_is_command "package" |
| 151 | then | 160 | then |
| 152 | if _guix_is_dash_L | 161 | if _guix_is_dash_L || _guix_is_dash_m |
| 153 | then | 162 | then |
| 154 | _guix_complete_file | 163 | _guix_complete_file |
| 155 | elif _guix_is_removing | 164 | elif _guix_is_removing |
