[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/23: bash completion: Fix ‘system’ & ‘container’ subcommands.
From: |
guix-commits |
Subject: |
07/23: bash completion: Fix ‘system’ & ‘container’ subcommands. |
Date: |
Sun, 3 Oct 2021 13:28:19 -0400 (EDT) |
nckx pushed a commit to branch master
in repository guix.
commit ed14bc298470f77f4ffacdc315ae87939f81c765
Author: Tobias Geerinckx-Rice <me@tobias.gr>
AuthorDate: Sun Oct 3 14:47:44 2021 +0200
bash completion: Fix ‘system’ & ‘container’ subcommands.
* etc/completion/bash/guix (_guix_complete): Count words from the
innermost command.
---
etc/completion/bash/guix | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index d5ec427..87d9911 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -284,8 +284,8 @@ _guix_complete ()
_guix_complete_available_package_or_store_file "$word_at_point"
elif [[ "$command" = "system" ]]
then
- case $COMP_CWORD in
- 2) _guix_complete_subcommand;;
+ case $((COMP_CWORD - command_index)) in
+ 1) _guix_complete_subcommand;;
*) _guix_complete_file;; # TODO: restrict to *.scm
esac
elif [[ "$command" = "pull" ]]
@@ -304,9 +304,9 @@ _guix_complete ()
fi
elif [[ "$command" = "container" ]]
then
- case $COMP_CWORD in
- 2) _guix_complete_subcommand;;
- 3) _guix_complete_pid "$word_at_point";;
+ case $((COMP_CWORD - command_index)) in
+ 1) _guix_complete_subcommand;;
+ 2) _guix_complete_pid "$word_at_point";;
*) _guix_complete_file;;
esac
elif [[ "$command" = "import" ]]
- branch master updated (c98c9c5 -> 91389d4), guix-commits, 2021/10/03
- 04/23: bash completion: Complete ‘guix weather’ packages., guix-commits, 2021/10/03
- 05/23: bash completion: Complete ‘guix build’ file names., guix-commits, 2021/10/03
- 07/23: bash completion: Fix ‘system’ & ‘container’ subcommands.,
guix-commits <=
- 02/23: bash completion: Consolidate similar $command ‘if’ branches., guix-commits, 2021/10/03
- 03/23: bash completion: Append to $COMPREPLY where possible., guix-commits, 2021/10/03
- 08/23: gnu: os-prober: Update to 1.79., guix-commits, 2021/10/03
- 11/23: gnu: ccache: Update to 4.4.2., guix-commits, 2021/10/03
- 14/23: gnu: dnsmasq: Prepare for cross-compilation., guix-commits, 2021/10/03
- 15/23: gnu: sx: Update to 2.1.7., guix-commits, 2021/10/03
- 17/23: gnu: yadifa: Update to 2.5.1 [security fixes]., guix-commits, 2021/10/03
- 09/23: gnu: libhx: Update to 4.0.1., guix-commits, 2021/10/03
- 10/23: gnu: snapraid: Update to 11.6., guix-commits, 2021/10/03
- 13/23: gnu: dnsmasq: Update to 2.86., guix-commits, 2021/10/03