Don't use abbreviated long options

"function --argument" is not a thing, it's "--argument-names". This only
accidentally works because our getopt is awful and allows abbreviated
long options.

Similarly, one argparse test used "--d" instead of "-d" or "--def".
This commit is contained in:
Fabian Homborg
2020-09-19 11:39:51 +02:00
parent 21077c0c9a
commit a3e20a4d38
13 changed files with 13 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
function __fish_append -d "Internal completion function for appending string to the commandline" --argument sep
function __fish_append -d "Internal completion function for appending string to the commandline" --argument-names sep
set -e argv[1]
set -l str (commandline -tc | string replace -rf "(.*$sep)[^$sep]*" '$1' | string replace -r -- '--.*=' '')
printf "%s\n" "$str"$argv

View File

@@ -1,4 +1,4 @@
function __fish_complete_convert_options --description 'Complete Convert options' --argument what
function __fish_complete_convert_options --description 'Complete Convert options' --argument-names what
switch $what
case format Format
convert -list Format | sed '1,/----/d; /^$/,$d; /^$/d; s/^\s*\([a-zA-Z0-9-]\+\)\**\s*\S\+\s\+\\(\S\+\)\s\+\(.\+\S\)\s*$/\1\t\2 \3/'

View File

@@ -3,7 +3,7 @@
# with description $argv[2] if defined, otherwise use 'Directory'.
# If no arguments are provided, attempts to complete current commandline token.
#
function __fish_complete_directories -d "Complete directory prefixes" --argument comp desc
function __fish_complete_directories -d "Complete directory prefixes" --argument-names comp desc
if not set -q desc[1]
set desc Directory
end

View File

@@ -1,4 +1,4 @@
function __fish_complete_list --argument div cmd prefix iprefix
function __fish_complete_list --argument-names div cmd prefix iprefix
if not set -q cmd[1]
echo "Usage:
__fish_complete_list <separator> <function> <prefix> <itemprefix>

View File

@@ -1,4 +1,4 @@
function __fish_complete_ssh -d "common completions for ssh commands" --argument command
function __fish_complete_ssh -d "common completions for ssh commands" --argument-names command
complete -c $command -s 1 -d "Protocol version 1 only"
complete -c $command -s 2 -d "Protocol version 2 only"
complete -c $command -s 4 -d "IPv4 addresses only"

View File

@@ -1,4 +1,4 @@
function __fish_is_token_n --description 'Test if current token is on Nth place' --argument n
function __fish_is_token_n --description 'Test if current token is on Nth place' --argument-names n
# Add a fake element to increment without calling math
set -l num (count (commandline -poc) additionalelement)
test $n -eq $num

View File

@@ -1,4 +1,4 @@
function __fish_print_help --description "Print help message for the specified fish function or builtin" --argument item error_message
function __fish_print_help --description "Print help message for the specified fish function or builtin" --argument-names item error_message
switch $item
case .
set item source