aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/eval.fish
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-10-09 18:07:57 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-10-09 18:07:57 -0700
commit9fc8729b960f085730e400bc3d9c3c47c3fc3c5e (patch)
tree849c5377941a9f2692b075c737698abc6f4da3c7 /share/functions/eval.fish
parent80859b84833a79d144b4784f0fd441ed7184d620 (diff)
Support -h/--help with `eval`
`eval` prints help if given a single argument of -h or --help. Fixes #1379.
Diffstat (limited to 'share/functions/eval.fish')
-rw-r--r--share/functions/eval.fish9
1 files changed, 9 insertions, 0 deletions
diff --git a/share/functions/eval.fish b/share/functions/eval.fish
index 939b17c9..15455402 100644
--- a/share/functions/eval.fish
+++ b/share/functions/eval.fish
@@ -1,4 +1,13 @@
function eval -S -d "Evaluate parameters as a command"
+ if not set -q argv[2]
+ # like most builtins, we only check for -h/--help
+ # if we only have a single argument
+ switch "$argv[1]"
+ case -h --help
+ __fish_print_help eval
+ return 0
+ end
+ end
# If we are in an interactive shell, eval should enable full
# job control since it should behave like the real code was