1
1
function _swift_math_commands_and_positionals -S
2
2
switch $positionals [1]
3
3
case ' math'
4
- _swift_math_commands_and_positionals_helper ' -s' ' version h/help'
4
+ _swift_math_commands_and_positionals_helper ' -s' ' version' ' h/help'
5
5
switch $positionals [1]
6
6
case ' add'
7
- _swift_math_commands_and_positionals_helper ' ' ' x/hex-output version h/help'
7
+ _swift_math_commands_and_positionals_helper ' ' ' x/hex-output' ' version' ' h/help'
8
8
case ' multiply'
9
- _swift_math_commands_and_positionals_helper ' ' ' x/hex-output version h/help'
9
+ _swift_math_commands_and_positionals_helper ' ' ' x/hex-output' ' version' ' h/help'
10
10
case ' stats'
11
- _swift_math_commands_and_positionals_helper ' -s' ' version h/help'
11
+ _swift_math_commands_and_positionals_helper ' -s' ' version' ' h/help'
12
12
switch $positionals [1]
13
13
case ' average'
14
- _swift_math_commands_and_positionals_helper ' ' ' kind= version h/help'
14
+ _swift_math_commands_and_positionals_helper ' ' ' kind=' ' version' ' h/help'
15
15
case ' stdev'
16
- _swift_math_commands_and_positionals_helper ' ' ' version h/help'
16
+ _swift_math_commands_and_positionals_helper ' ' ' version' ' h/help'
17
17
case ' quantiles'
18
- _swift_math_commands_and_positionals_helper ' ' ' file= directory= shell= custom= version h/help'
18
+ _swift_math_commands_and_positionals_helper ' ' ' file=' ' directory=' ' shell=' ' custom=' ' version' ' h/help'
19
19
end
20
20
case ' help'
21
21
_swift_math_commands_and_positionals_helper ' ' ' version'
@@ -26,14 +26,15 @@ function _swift_math_commands_and_positionals -S
26
26
end
27
27
end
28
28
29
- function _swift_math_commands_and_positionals_helper -S -a argparse_options -a option_specs
29
+ function _swift_math_commands_and_positionals_helper -S -a argparse_options
30
+ set -l option_specs $argv [2..]
30
31
set -a commands $positionals [1]
31
32
set -e positionals[1]
32
33
if test -z $argparse_options
33
- argparse -n " $commands " (string split -- ' ' $option_specs ) -- $positionals 2> /dev/null
34
+ argparse -n " $commands " $option_specs -- $positionals 2> /dev/null
34
35
set positionals $argv
35
36
else
36
- argparse (string split -- ' ' $argparse_options ) -n " $commands " (string split -- ' ' $option_specs ) -- $positionals 2> /dev/null
37
+ argparse (string split -- ' ' $argparse_options ) -n " $commands " $option_specs -- $positionals 2> /dev/null
37
38
set positionals $argv
38
39
end
39
40
end
0 commit comments