summary refs log tree commit diff
path: root/etc
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2023-12-10 01:00:00 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2023-12-10 01:00:00 +0100
commitfa0563e7fa4effbeb86ad0fb377d1bfe5a4c8bdc (patch)
treea0b2d95b302d05f1f6808bc1c8cdded52c466c45 /etc
parentd993ed43b2bae8717437aa27d9d33fd223a6411f (diff)
downloadguix-fa0563e7fa4effbeb86ad0fb377d1bfe5a4c8bdc.tar.gz
bash completion: Complete ‘guix style -f’ with files.
* etc/completion/bash/guix (_guix_is_dash_f):
Recognise ‘--whole-file’ as a member of the ‘-f’ family.
(_guix_complete): Add a new clause for ‘guix style’.

Reported by cmiller in #guix.

Change-Id: I3f55f7fd7fb8610dc13770ebfe70d9f65c1497af
Diffstat (limited to 'etc')
-rw-r--r--etc/completion/bash/guix11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix
index 7b1f639371..ab441a2540 100644
--- a/etc/completion/bash/guix
+++ b/etc/completion/bash/guix
@@ -139,7 +139,8 @@ _guix_is_dash_f ()
 {
     _guix_is_short_option f ||
     _guix_is_long_option file ||
-    _guix_is_long_option install-from-file
+    _guix_is_long_option install-from-file ||
+    _guix_is_long_option whole-file
 }
 
 _guix_is_dash_l ()
@@ -333,6 +334,14 @@ _guix_complete ()
 		else
 		    _guix_complete_available_package "$word_at_point"
                 fi
+            elif [[ "$command" = "style" ]]
+            then
+		if _guix_is_dash_f
+		then
+		    _guix_complete_file
+		else
+		    _guix_complete_available_package "$word_at_point"
+		fi
 	    else
 		_guix_complete_available_package "$word_at_point"
 	    fi