fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
30e6aa85e
master
1#RUN: %fish %s 2# Verify that specifying unexpected options or arguments results in an error. 3 4# First using the legacy, now deprecated, long options to specify a 5# subcommand. 6 7# First with the history function. 8history --search --merge 9#CHECKERR: history: merge search: options cannot be used together 10history --clear --contains 11#CHECKERR: history: clear: subcommand takes no options 12history --merge -t 13#CHECKERR: history merge: subcommand takes no options 14history --save xyz 15#CHECKERR: history save: expected 0 arguments; got 1 16 17# Now with the history builtin. 18builtin history --save --prefix 19#CHECKERR: history save: subcommand takes no options 20builtin history --clear --show-time 21#CHECKERR: history clear: subcommand takes no options 22builtin history --merge xyz 23#CHECKERR: history merge: expected 0 arguments; got 1 24builtin history --clear abc def 25#CHECKERR: history clear: expected 0 arguments; got 2 26 27# Now using the preferred subcommand form. Note that we support flags before 28# or after the subcommand name so test both variants. 29 30# First with the history function. 31history clear --contains 32#CHECKERR: history: clear: subcommand takes no options 33history clear-session --contains 34#CHECKERR: history clear-session: subcommand takes no options 35history merge -t 36#CHECKERR: history merge: subcommand takes no options 37history save xyz 38#CHECKERR: history save: expected 0 arguments; got 1 39history --prefix clear 40#CHECKERR: history: clear: subcommand takes no options 41history --prefix clear-session 42#CHECKERR: history clear-session: subcommand takes no options 43history --show-time merge 44#CHECKERR: history merge: subcommand takes no options 45 46# Now with the history builtin. 47builtin history --search --merge 48#CHECKERR: history: search merge: options cannot be used together 49builtin history save --prefix 50#CHECKERR: history save: subcommand takes no options 51builtin history clear --show-time 52#CHECKERR: history clear: subcommand takes no options 53builtin history clear-session --show-time 54#CHECKERR: history clear-session: subcommand takes no options 55builtin history merge xyz 56#CHECKERR: history merge: expected 0 arguments; got 1 57builtin history clear abc def 58#CHECKERR: history clear: expected 0 arguments; got 2 59builtin history clear-session abc def 60#CHECKERR: history clear-session: expected 0 arguments; got 2 61builtin history --contains save 62#CHECKERR: history save: subcommand takes no options 63builtin history -t merge 64#CHECKERR: history merge: subcommand takes no options 65 66# Now do a history command that should succeed so we exit with a zero, 67# success, status. 68builtin history save 69 70set -g fish_private_mode1 71builtin history merge 72#CHECKERR: history: can't merge history in private mode 73 74builtin history -n abc 75#CHECKERR: history: abc: invalid integer 76 77builtin history delete --prefix abc 78#CHECKERR: builtin history delete only supports --exact 79 80builtin history delete --exact abc 81#CHECKERR: builtin history delete --exact requires --case-sensitive