diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-10-03 13:15:56 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2021-10-03 19:23:48 +0200 |
| commit | 6fba67df1928a62abc7939bd8ff020e998ad8d6b (patch) | |
| tree | eb6cd7dac1521cb7f32a5d32e8517d872b8b24db /etc/completion/bash | |
| parent | 83128c97d44311c7ed715c92edad8474e727c048 (diff) | |
bash completion: Consolidate similar $command ‘if’ branches.
* etc/completion/bash/guix (_guix_complete): Combine the ‘upgrade’ and
‘remove’ commands, as well as ‘download’, ‘gc’, and ‘hash’.
Diffstat (limited to 'etc/completion/bash')
| -rw-r--r-- | etc/completion/bash/guix | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index a9386e7794d..112ea789de1 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix | |||
| @@ -237,15 +237,7 @@ _guix_complete () | |||
| 237 | else | 237 | else |
| 238 | _guix_complete_available_package "$word_at_point" | 238 | _guix_complete_available_package "$word_at_point" |
| 239 | fi | 239 | fi |
| 240 | elif [[ "$command" = "remove" ]] | 240 | elif [[ "$command" = "upgrade" || "$command" = "remove" ]] |
| 241 | then | ||
| 242 | if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p | ||
| 243 | then | ||
| 244 | _guix_complete_file | ||
| 245 | else | ||
| 246 | _guix_complete_installed_package "$word_at_point" | ||
| 247 | fi | ||
| 248 | elif [[ "$command" = "upgrade" ]] | ||
| 249 | then | 241 | then |
| 250 | if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p | 242 | if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p |
| 251 | then | 243 | then |
| @@ -272,9 +264,9 @@ _guix_complete () | |||
| 272 | else | 264 | else |
| 273 | _guix_complete_available_package "$word_at_point" | 265 | _guix_complete_available_package "$word_at_point" |
| 274 | fi | 266 | fi |
| 275 | elif [[ "$command" = "download" ]] | 267 | elif [[ "$command" = "download" || "$command" = "gc" || "$command" = "hash" ]] |
| 276 | then | 268 | then |
| 277 | _guix_complete_file | 269 | _guix_complete_file |
| 278 | elif [[ "$command" = "system" ]] | 270 | elif [[ "$command" = "system" ]] |
| 279 | then | 271 | then |
| 280 | case $COMP_CWORD in | 272 | case $COMP_CWORD in |
| @@ -305,9 +297,6 @@ _guix_complete () | |||
| 305 | elif [[ "$command" = "import" ]] | 297 | elif [[ "$command" = "import" ]] |
| 306 | then | 298 | then |
| 307 | _guix_complete_subcommand | 299 | _guix_complete_subcommand |
| 308 | elif [[ "$command" = "hash" || "$command" = "gc" ]] | ||
| 309 | then | ||
| 310 | _guix_complete_file | ||
| 311 | elif [[ "$command" = "weather" ]] | 300 | elif [[ "$command" = "weather" ]] |
| 312 | then | 301 | then |
| 313 | if _guix_is_dash_m | 302 | if _guix_is_dash_m |
