-
Notifications
You must be signed in to change notification settings - Fork 242
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
ArgumentParser as a container #227
Comments
@skrobinson hmm good question... I'm definitely not against having container-like access like you have here. I think maybe there's an alternate route to go with inheritance and making the members protected. I'm not sure if maybe this would make testing insanely more difficult, but in the spirit of Python's |
I'm not a fan of leaking the core of the internal implementation details and would prefer to avoid it. Future versions of From any research I've done on this, it appears that people create some kind of BaseCommand class with a I haven't found any example where a developer directly inherits from I'm certainly a fan of |
I felt a little bit confuse about it. What's the main difference vs [] in ArgumentParse? [] looks like also provide the reference of Argument. |
With |
@lingerer The difference is that I misread But, the main advantage I see to program.at("--help")
program.at<ArgumentParser>("add")
// versus
program["--help"]
program.operator[]<ArgumentParser>("add") |
If it provide more type transform or something for the reference , I think it will be a better way than [] just return as it is. |
This allows updating attached object properties without holding external references to the various Argument and ArgumentParser objects. Closes p-ranav#227 Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
This allows updating attached object properties without holding external references to the various Argument and ArgumentParser objects. Closes p-ranav#227 Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
Recent Issues (#217, #224) make me think people want container-like access to
ArgumentParser
. I'm considering addingArgumentParser::at
to returnArgument
and subparser instances.Thoughts, @p-ranav, @lingerer, @bwpge?
The text was updated successfully, but these errors were encountered: