mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
printf: Ignore any options
This was misguidedly "fixed" in
9e08609f85, which made printf error out
with any "-"-prefixed words as the first argument.
Note: This means currently `printf --help` doesn't print the help.
This also matches `echo`, and we currently don't have anything to make
a literal `--help` execute a builtin help except for keywords. Oh well.
Fixes #9132
This commit is contained in:
@@ -119,3 +119,18 @@ printf '%d\n' 0g
|
||||
# CHECKERR: 0g: value not completely converted (can't convert 'g')
|
||||
echo $status
|
||||
# CHECK: 1
|
||||
|
||||
# Test that we ignore options
|
||||
printf -a
|
||||
printf --foo
|
||||
# CHECK: -a--foo
|
||||
echo
|
||||
|
||||
set -l helpvar --help
|
||||
printf $helpvar
|
||||
echo
|
||||
# CHECK: --help
|
||||
|
||||
printf --help
|
||||
echo
|
||||
# CHECK: --help
|
||||
|
||||
Reference in New Issue
Block a user