mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
functions/history.fish: validate command line arguments in wrapper
Closes #2055. Implements the standard `--` option for delimiting options from arguments; to search for "--", use `history --search -- --`.
This commit is contained in:
parent
299a383d98
commit
a7ecc0db1f
1 changed files with 7 additions and 1 deletions
|
@ -33,7 +33,13 @@ function history --description "Deletes an item from history"
|
|||
case --clear
|
||||
set cmd clear
|
||||
case --search
|
||||
set cmd print
|
||||
set cmd print
|
||||
case --
|
||||
set -e argv[$i]
|
||||
break
|
||||
case -* --*
|
||||
printf ( _ "%s: invalid option -- %s\n" ) history $argv[1] >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue