The Command type now includes a pointer to an Argument array which lists the positional arguments for the command.
Additional Argument arrays with prefix docopt_ are generated for each command.
parseargcmd will now assign value in the matching argument of elements->arguments and the positional docopt arrays.
argument->value = argument value
argument->count = number of arguments on the command line including this one (for counting ...)
argument->array = points to argv for this argument (for ...)
Usage for positional arguments would be something like.
I've made a number of improvements to my fork and it now works with [options] either before or after the required positional arguments. The naval fate example now works.
I needed handling of positional arguments as well as one or more arguments so I made some changes which you can find here.
https://github.com/jkcko/docopt.c/commit/23a68dd845985bf1cdeed1cc94dbae9e48a19e49
The Command type now includes a pointer to an Argument array which lists the positional arguments for the command.
Additional Argument arrays with prefix docopt_ are generated for each command.
parseargcmd will now assign value in the matching argument of elements->arguments and the positional docopt arrays.
argument->value = argument value
argument->count = number of arguments on the command line including this one (for counting ...)
argument->array = points to argv for this argument (for ...)
Usage for positional arguments would be something like.
Usage for ... would be something like.
Caveat: [options] combined with positional arguments is not supported.