cli: fix #161 by inverting test argument order

Since `test` interprets arguments starting with a single dash as
options when comparing `test -h = --help` just swap parameter
orders as in `test --help = -h`. Also related to issue #161 is the
issue from fish repository at fish-shell/fish-shell#2332
This commit is contained in:
Derek Stavis 2015-11-05 11:48:57 -02:00 committed by Derek Stavis
parent 69caabfe89
commit 3fb8b3484b

View File

@ -33,7 +33,7 @@ function omf -d "Oh My Fish"
if test (count $argv) -eq 0
omf.help "main"; and return 0
else
if test $argv[-1] = "--help" -a (count $argv) = 2
if test "--help" = "$argv[-1]" -a (count $argv) = 2
omf.help $argv[1..-2]; and return 0
end
end