Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of parsed tokens? #28

Open
Schnouki opened this issue May 14, 2014 · 2 comments
Open

Number of parsed tokens? #28

Schnouki opened this issue May 14, 2014 · 2 comments

Comments

@Schnouki
Copy link

Hi,

I'm using docopt to parse arguments for my program. This program then calls a library function that accepts argc, argv arguments to do its own argument parsing. And I'd like to be able to call ./my_program --my-arg --my-other-arg -- --lib-arg --other-lib-arg.

Basically, I'd need to be know how many tokens have been parsed by docopt, so that I can pass (argc - parsed_tokens) and [argv[0]] + argv[parsed_tokens:] to that lib (using a Python syntax to be clearer 😉).

Would it be possible to add something similar to docopt? If I'm the only one interested in such a feature and if I end up writing it, would you be interested in merging it? :)

Thanks!

@keleshev
Copy link
Member

keleshev commented Aug 2, 2014

Sorry for late reply.

In reference implementation, it is possible to have the following usage:

usage: my_program [--my-arg --my-other-arg] [--] [<args>...]

In this case, you invocation will capture ['--lib-arg', '--other-lib-arg'] as <args>. However, this doesn't seem to be supported in docopt.c currently.

Docopt.c has a bit of a stale period of development right now, so I'm not sure if this is going to be supported soon. @kblomqvist, what do you think?

@kblomqvist
Copy link
Member

Unfortunately that's the case (not going to be supported soon (by me)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants