forked from jorgebucaran/getopts.fish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlong.fish
27 lines (18 loc) · 925 Bytes
/
long.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@mesg $current_filename
@test "without value" (getopts --foo) = "foo true"
@test "as the last argument" (getopts --foo=bar --baz) = "foo bar baz true"
@test "implicit value" (getopts --foo 001 --bar baz) = "foo 001 bar baz"
@test "explicit value" (getopts --foo=001 --bar=baz) = "foo 001 bar baz"
@test "name may be formed by any characters" (
getopts --foo 01 --bar=2 --baz3 --34m
) = "foo 01 bar 2 baz3 true 34m true"
@test "split value after first =" (getopts --foo=e=mc\^2) = "foo e=mc^2"
@test "mixed boolean, string, and numbers" (
getopts --foo bar baz --fum --bam=pow --qux 0.1
) = "foo bar _ baz fum true bam pow qux 0.1"
@test "empty strings and other characters" (
getopts --foo=/foo/bar/baz foobar --fum= --bam=.99 --pow=@
) = "foo /foo/bar/baz _ foobar fum bam .99 pow @"
@test "more special characters" (
getopts --@foo=bar ----bg-color=red --=void
) = "@foo bar --bg-color red void"