diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-12-10 01:00:00 +0100 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2023-12-10 01:00:00 +0100 |
| commit | fa0563e7fa4effbeb86ad0fb377d1bfe5a4c8bdc (patch) | |
| tree | a0b2d95b302d05f1f6808bc1c8cdded52c466c45 | |
| parent | d993ed43b2bae8717437aa27d9d33fd223a6411f (diff) | |
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
| -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 7b1f639371f..ab441a2540f 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix | |||
| @@ -139,7 +139,8 @@ _guix_is_dash_f () | |||
| 139 | { | 139 | { |
| 140 | _guix_is_short_option f || | 140 | _guix_is_short_option f || |
| 141 | _guix_is_long_option file || | 141 | _guix_is_long_option file || |
| 142 | _guix_is_long_option install-from-file | 142 | _guix_is_long_option install-from-file || |
| 143 | _guix_is_long_option whole-file | ||
| 143 | } | 144 | } |
| 144 | 145 | ||
| 145 | _guix_is_dash_l () | 146 | _guix_is_dash_l () |
| @@ -333,6 +334,14 @@ _guix_complete () | |||
| 333 | else | 334 | else |
| 334 | _guix_complete_available_package "$word_at_point" | 335 | _guix_complete_available_package "$word_at_point" |
| 335 | fi | 336 | fi |
| 337 | elif [[ "$command" = "style" ]] | ||
| 338 | then | ||
| 339 | if _guix_is_dash_f | ||
| 340 | then | ||
| 341 | _guix_complete_file | ||
| 342 | else | ||
| 343 | _guix_complete_available_package "$word_at_point" | ||
| 344 | fi | ||
| 336 | else | 345 | else |
| 337 | _guix_complete_available_package "$word_at_point" | 346 | _guix_complete_available_package "$word_at_point" |
| 338 | fi | 347 | fi |
