mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +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
|
@ -34,6 +34,12 @@ function history --description "Deletes an item from history"
|
|||
set cmd clear
|
||||
case --search
|
||||
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