mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Fix apt subcommand option completions
This commit is contained in:
parent
240bb25dbe
commit
27d7feaf95
2 changed files with 21 additions and 4 deletions
|
@ -28,6 +28,7 @@
|
|||
- `read` failures due to too much data should define the var (#4180).
|
||||
- multiple `read` commands in non-interactive scripts were broken in fish 2.6.0 (#4206).
|
||||
- Fix regression involving universal variables with side-effects at startup such as `set -U fish_escape_delay_ms 10` (#4196).
|
||||
- Option completion for `apt list` now works properly (#4350).
|
||||
- Added completions for:
|
||||
- `as` (#4130).
|
||||
- `jest` (#4142).
|
||||
|
|
|
@ -19,10 +19,26 @@ function __fish_apt_use_package --description 'Test if apt command should have p
|
|||
end
|
||||
|
||||
function __fish_apt_subcommand
|
||||
set subcommand $argv[1]; set -e argv[1]
|
||||
set subcommand $argv[1]
|
||||
set -e argv[1]
|
||||
complete -f -c apt -n '__fish_apt_no_subcommand' -a $subcommand $argv
|
||||
end
|
||||
|
||||
function __fish_apt_using_subcommand --description 'Test if given subcommand is used'
|
||||
for i in (commandline -opc)
|
||||
if contains -- $i $argv
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_apt_option
|
||||
set subcommand $argv[1]
|
||||
set -e argv[1]
|
||||
complete -f -c apt -n "__fish_apt_using_subcommand $subcommand" $argv
|
||||
end
|
||||
|
||||
complete -c apt -n '__fish_apt_use_package' -a '(__fish_print_packages)' --description 'Package'
|
||||
|
||||
# Support flags
|
||||
|
@ -36,9 +52,9 @@ complete -f -c apt -s t --description 'Target release'
|
|||
|
||||
# List
|
||||
__fish_apt_subcommand list --description 'List packages'
|
||||
__fish_apt_subcommand list -l installed --description 'Installed packages'
|
||||
__fish_apt_subcommand list -l upgradable --description 'Upgradable packages'
|
||||
__fish_apt_subcommand list -l all-versions --description 'Show all versions of any package'
|
||||
__fish_apt_option list -l installed --description 'Installed packages'
|
||||
__fish_apt_option list -l upgradable --description 'Upgradable packages'
|
||||
__fish_apt_option list -l all-versions --description 'Show all versions of any package'
|
||||
|
||||
# Search
|
||||
__fish_apt_subcommand search -r --description 'Search for packages'
|
||||
|
|
Loading…
Reference in a new issue