diff --git a/antigen.zsh b/antigen.zsh index bef9542..45392aa 100644 --- a/antigen.zsh +++ b/antigen.zsh @@ -423,7 +423,10 @@ antigen () { i=$(($i + 1)) done - local keyword_args="$(echo "$spec" | cut -d\; -f2 | tr , '\n')" + local keyword_args="$( + echo "$positional_args" | tr , '\n' | sed -r 's/(\??)$/:\1/' + echo "$spec" | cut -d\; -f2 | tr , '\n' + )" local keyword_args_count="$(echo $keyword_args | awk -F, '{print NF}')" # Set spec values from keyword arguments, if any. The remaining arguments diff --git a/tests/arg-parser.t b/tests/arg-parser.t index ac7cda8..163fc16 100644 --- a/tests/arg-parser.t +++ b/tests/arg-parser.t @@ -46,3 +46,8 @@ Provide value for keyword argument, that shouldn't be there. $ parse --no-local-clone=yes No argument required for 'no-local-clone', but provided 'yes'. + +Positional argument as a keyword argument. + + $ parse --url=some-url + local url='some-url'