fish-shell/tests/history.in

45 lines
1.2 KiB
Fish
Raw Normal View History

# 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
2017-07-14 07:21:14 +08:00
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
2017-07-14 07:21:14 +08:00
history --show-time merge
echo >&2
# Now with the history builtin.
builtin history --search --merge
builtin history save --prefix
2017-07-14 07:21:14 +08:00
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