Skip to content

How do I set an option as an integer when using source generation? #188

Answered by atifaziz
giggio asked this question in Q&A
Discussion options

You must be logged in to vote

The docopt format has no means of specifying the type of a positional or option argument therefore docopt.net doesn't support anything but string-based arguments at the fundamental level. This helps to keep the library simple, make it do one thing and try do it as well as possible. The moment you get into type conversion, you open a can of worms of expectations and the complexity explodes. The status of docopt.net is MVP for general utility. That doesn't mean such support cannot land in the future, but more on that later.

Once the parsing is done into properties of the arguments class generated by the source generator, it is up to the application to do the conversion to other types. This …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@giggio
Comment options

@atifaziz
Comment options

Answer selected by atifaziz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants