mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
completions/apt: Use is_first_token instead of seen_subcommand_from
I think this should be preferred for all subcommand completions because it handles typos or subcommands we don't recognize better (`apt foo <TAB>` no longer suggests subcommands since the subcommand position has been taken).
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Completions for the `apt` command
|
||||
|
||||
# macOS has a /usr/bin/apt that is something else entirely:
|
||||
# macOS has a /usr/bin/apt that is something else entirely:
|
||||
# (apt - Returns the path to a Java home directory from the current user's settings)
|
||||
if [ "$(uname -s)" = Darwin -a "$(command -s apt)" = /usr/bin/apt ]
|
||||
exit 1
|
||||
@@ -14,7 +14,7 @@ set -l handle_file_pkg_subcmds install
|
||||
function __fish_apt_subcommand -V all_subcmds
|
||||
set -l subcommand $argv[1]
|
||||
set -e argv[1]
|
||||
complete -f -c apt -n "not __fish_seen_subcommand_from $all_subcmds" -a $subcommand $argv
|
||||
complete -f -c apt -n "__fish_is_first_token" -a $subcommand $argv
|
||||
end
|
||||
|
||||
function __fish_apt_option
|
||||
|
||||
Reference in New Issue
Block a user