Make --help work

See #5361.
This commit is contained in:
Fabian Homborg
2018-11-22 12:43:35 +01:00
parent b383e29a24
commit 3a835ebd61
4 changed files with 24 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ function realpath -d "return an absolute path without symlinks"
set -l options 'h/help' 'q/quiet' 'V-version' 's/strip' 'N-no-symlinks' 'z/zero'
set -a options 'e/canonicalize-existing' 'm/canonicalize-missing' 'L/logical' 'P/physical'
set -a options 'R-relative-to=' 'B-relative-base='
argparse -n realpath --min-args=1 $options -- $argv
argparse -n realpath $options -- $argv
or return
if set -q _flag_help
@@ -42,6 +42,11 @@ function realpath -d "return an absolute path without symlinks"
return 1
end
if not set -q argv[1]
printf (_ "%ls: Expected at least %d args, got only %d\n") realpath 1 0
return 1
end
for path in $argv
builtin realpath $path
end