Let command, jobs and type take --query instead of --quiet

Now command, jobs, type, abbr, builtin, functions and set take `-q` to
query for existence, but the long option is inconsistent.

The first three use `--quiet`, the latter use `--query`. Add `--query`
to the first three, but keep `--quiet` around.

Fixes #7276.
This commit is contained in:
Fabian Homborg
2020-09-04 16:41:34 +02:00
parent 6ca2dbecfb
commit bfb5b28d0f
11 changed files with 41 additions and 7 deletions

View File

@@ -3,7 +3,8 @@ function type --description 'Print the type of a command'
set -q argv[1]
or return 1
set -l options h/help a/all s/short f/no-functions t/type p/path P/force-path q/quiet
# --query is the same thing as --quiet
set -l options h/help a/all s/short f/no-functions t/type p/path P/force-path q/quiet Q-query
argparse -n type -x t,p,P $options -- $argv
or return
@@ -21,7 +22,7 @@ function type --description 'Print the type of a command'
# Technically all four of these flags are mutually exclusive. However, we allow -q to be used
# with the other three because old versions of this function explicitly allowed it by making
# --quiet have precedence.
if set -q _flag_quiet
if set -q _flag_quiet; or set -q _flag_query
set mode quiet
else if set -q _flag_type
set mode type