diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-10-03 14:47:44 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-10-03 19:23:49 +0200 |
| commit | ed14bc298470f77f4ffacdc315ae87939f81c765 (patch) | |
| tree | 6eb872ca61b56b53ad6ab26935f969f15e86a85a | |
| parent | d71cfaea3006bc02dc6d309d916809e1f799f04e (diff) | |
bash completion: Fix ‘system’ & ‘container’ subcommands.
* etc/completion/bash/guix (_guix_complete): Count words from the
innermost command.
| -rw-r--r-- | etc/completion/bash/guix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index d5ec427e0c5..87d9911e53a 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix | |||
| @@ -284,8 +284,8 @@ _guix_complete () | |||
| 284 | _guix_complete_available_package_or_store_file "$word_at_point" | 284 | _guix_complete_available_package_or_store_file "$word_at_point" |
| 285 | elif [[ "$command" = "system" ]] | 285 | elif [[ "$command" = "system" ]] |
| 286 | then | 286 | then |
| 287 | case $COMP_CWORD in | 287 | case $((COMP_CWORD - command_index)) in |
| 288 | 2) _guix_complete_subcommand;; | 288 | 1) _guix_complete_subcommand;; |
| 289 | *) _guix_complete_file;; # TODO: restrict to *.scm | 289 | *) _guix_complete_file;; # TODO: restrict to *.scm |
| 290 | esac | 290 | esac |
| 291 | elif [[ "$command" = "pull" ]] | 291 | elif [[ "$command" = "pull" ]] |
| @@ -304,9 +304,9 @@ _guix_complete () | |||
| 304 | fi | 304 | fi |
| 305 | elif [[ "$command" = "container" ]] | 305 | elif [[ "$command" = "container" ]] |
| 306 | then | 306 | then |
| 307 | case $COMP_CWORD in | 307 | case $((COMP_CWORD - command_index)) in |
| 308 | 2) _guix_complete_subcommand;; | 308 | 1) _guix_complete_subcommand;; |
| 309 | 3) _guix_complete_pid "$word_at_point";; | 309 | 2) _guix_complete_pid "$word_at_point";; |
| 310 | *) _guix_complete_file;; | 310 | *) _guix_complete_file;; |
| 311 | esac | 311 | esac |
| 312 | elif [[ "$command" = "import" ]] | 312 | elif [[ "$command" = "import" ]] |
