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

Lib rather than generator? #38

Open
mcandre opened this issue Feb 27, 2017 · 1 comment
Open

Lib rather than generator? #38

mcandre opened this issue Feb 27, 2017 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Feb 27, 2017

Could doctopt provide a more typical C-style library, instead of a code generator?

I would like to be able to #include "docopt.h", gcc -ldocopt, etc.

@kroq-gar78
Copy link

kroq-gar78 commented May 30, 2017

I'm dumping my thoughts here on how this would work.

If this were to happen, aside from translating most of the logic from Python to C, the struct would also have to be changed to some sort of map. It looks like almost everywhere else, you can substitute code generation with some for loops (e.g. with a list of possible options). For default arguments, that would probably also have to be a map.

Aside from those, the rest of the work would really come from parsing the docopt file.

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

2 participants