mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 05:20:35 +08:00
76c73aa8ce
This deprecates the use of long options for history sub-commands (e.g., `history --delete`) in favor of proper sub-commands (e.g., `history delete`). It also eliminates the short options for those sub-commands. Also change option processing to allow options anywhere on the command line to match how the vast majority of fish builtins handle flags. Replace --with-time with --show-time. Fixes #3367
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 --with-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 --with-time merge
|
|
echo >&2
|
|
|
|
# Now with the history builtin.
|
|
builtin history --search --merge
|
|
builtin history save --prefix
|
|
builtin history clear --with-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
|