mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-02-21 06:18:24 +08:00
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:
parent
69caabfe89
commit
3fb8b3484b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user