diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-04 23:54:43 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-04 23:54:43 -0700 |
commit | be1d216b34c5e9c8dd89b60362883c21c5edc5fc (patch) | |
tree | de5064fea0d4c5bf7cbd17132d93a7b890adb667 /share/functions/history.fish | |
parent | 85cbb943b56d143ef93cd1a2e1b36145152b6d7d (diff) |
Relnoted history builtin
Tweaked validation regex to use extended regexs
Diffstat (limited to 'share/functions/history.fish')
-rw-r--r-- | share/functions/history.fish | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/share/functions/history.fish b/share/functions/history.fish index 17cd9d93..16a3f4af 100644 --- a/share/functions/history.fish +++ b/share/functions/history.fish @@ -53,8 +53,8 @@ function history --description "Deletes an item from history" end read --local --prompt "echo 'Delete which entries? > '" choice - set choice (echo $choice | tr " " "\n") - + set choice (echo $choice | tr " " "\n") + for i in $choice # Skip empty input; for example, if the user just hits return @@ -63,7 +63,7 @@ function history --description "Deletes an item from history" end #Following two validations could be embedded with "and" but I find the syntax kind of weird. - if not echo $i | grep -q "^[0-9]+\$" + if not echo $i | grep -E -q "^[0-9]+\$" printf "Invalid input: %s\n" $i continue end |