File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
1
name = " ArgMacros"
2
2
uuid = " dbc42088-9de8-42a0-8ec8-2cd114e1ea3e"
3
3
authors = [" zachmatson" ]
4
- version = " 0.1.0 "
4
+ version = " 0.1.1 "
5
5
6
6
[deps ]
7
7
TextWrap = " b718987f-49a8-5099-9789-dcd902bef87d"
Original file line number Diff line number Diff line change @@ -33,14 +33,24 @@ function _split_arguments(args::Vector{String})::Vector{String}
33
33
splitargs = Vector {String} ()
34
34
35
35
for arg in args
36
- # Expand arg/value pairs with = to separate entries
37
- for splitarg in split (arg, ' =' )
36
+ # Flags/options
37
+ if arg[1 ] == ' -'
38
+ arg_split = split (arg, ' =' , limit= 2 ):: Vector{SubString{String}}
39
+
38
40
# Handle chained flags or flags with Int values like "-xzfv" or "-O3"
39
- if splitarg[1 ] == ' -' && splitarg[2 ] != ' -' && length (splitarg) > 2
40
- append! (splitargs, _split_multiflag (splitarg))
41
+ if length (arg_split[1 ]) > 2 && arg_split[1 ][2 ] != ' -'
42
+ append! (splitargs, _split_multiflag (arg_split[1 ]))
43
+
44
+ if length (arg_split) == 2
45
+ push! (splitargs, arg_split[2 ])
46
+ end
47
+ # Handle other flags
41
48
else
42
- push ! (splitargs, splitarg )
49
+ append ! (splitargs, arg_split )
43
50
end
51
+ # Values
52
+ else
53
+ push! (splitargs, arg)
44
54
end
45
55
end
46
56
You can’t perform that action at this time.
0 commit comments