Conversation
6280975 to
2ede161
Compare
Pull Request Test Coverage Report for Build 2734Details
💛 - Coveralls |
b62c1c9 to
b286791
Compare
7e43c91 to
b59017e
Compare
|
I have the following suggestions: The parameter Another optional suggestion is to consider merging the three parameters ( |
|
A question: Why are errors generated when building a Command deferred until argument parsing time to be raised? It would be better if they could be raised immediately. I mean: changing the signature of |
|
|
The rational was to avoid making them to verbose, because we would have Command(flags=[FlagArg(xxx)], options=[OptionArg(xxx)])instead of having just Command(args=[FlagArg(xxx), OptionArg(xxx)]) |
The rational is that the final check involves checking the configuration from the parent + the subcommand. And it is not expected to be raised too often because when we finish defining the arg parser, it is likely to be stable. I think for clap in Rust it's actually checked only under debug mode. |
Actually, here's how it looks when users use it: @argparse.Command(args=[@argparse.FlagArg(xxx), @argparse.OptionArg(xxx)])instead of @argparse.Command(flags=[FlagArg(xxx)], options=[OptionArg(xxx)])Unless the user imports it with |
I'm not entirely sure what you mean. Do you mean that this situation might exist? So the error cannot be raised in the first two lines |
I just thought about it again, and I believe |
3d56c2f to
ff91a5b
Compare
122a6e3 to
40cf530
Compare
|
@FlyCloudC I agree. Having |
d802d88 to
49b58a6
Compare
This PR adds an arg parser that is inspired by clap but with reduced API because we want to focus on the clarity of the behavior. A lot of extra checks were imposed.
The API of this PR is roughly determined, but the internal implementation can still be improved drastically.
@FlyCloudC Do you think you would like to give it a review in terms of the API? (I know the internal implementation is a bit messy).