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:
David Adam 2015-07-31 17:07:27 +08:00
parent 299a383d98
commit a7ecc0db1f

View file

@ -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