mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-18 12:33:38 +08:00
45 lines
1.2 KiB
Fish
45 lines
1.2 KiB
Fish
# Verify that specifying unexpected options or arguments results in an error.
|
|
|
|
# First using the legacy, now deprecated, long options to specify a
|
|
# subcommand.
|
|
|
|
# First with the history function.
|
|
history --search --merge
|
|
history --clear --contains
|
|
history --merge -t
|
|
history --save xyz
|
|
|
|
# Now with the history builtin.
|
|
builtin history --save --prefix
|
|
builtin history --clear --show-time
|
|
builtin history --merge xyz
|
|
builtin history --clear abc def
|
|
|
|
# Put a blank line in the stderr output to separate the above sequence from
|
|
# the following sequence of tests.
|
|
echo >&2
|
|
|
|
# Now using the preferred subcommand form. Note that we support flags before
|
|
# or after the subcommand name so test both variants.
|
|
|
|
# First with the history function.
|
|
history clear --contains
|
|
history merge -t
|
|
history save xyz
|
|
history --prefix clear
|
|
history --show-time merge
|
|
echo >&2
|
|
|
|
# Now with the history builtin.
|
|
builtin history --search --merge
|
|
builtin history save --prefix
|
|
builtin history clear --show-time
|
|
builtin history merge xyz
|
|
builtin history clear abc def
|
|
builtin history --contains save
|
|
builtin history -t merge
|
|
|
|
# Now do a history command that should succeed so we exit with a zero,
|
|
# success, status.
|
|
builtin history save
|