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

No clean way to handle unknown options #722

Open
rakudrama opened this issue Nov 22, 2024 · 0 comments
Open

No clean way to handle unknown options #722

rakudrama opened this issue Nov 22, 2024 · 0 comments

Comments

@rakudrama
Copy link
Member

There is a built-in assumption in this library that we know everything about all the commands.
When the command is external, e.g. a program that is run in a process, there is no clean way to handle the arguments to that command that we don't know about.

ArgParser.allowAnything() is a blunt tool that partly works around this.
It does several things:

  • It allows a subcommand to ignore supercommand arguments
  • It allows unknown options to be collected
  • Unfortunately, 'allowAnything' does not allow options and flags to be defined.

These two ideas (whether to honor or ignore the supercommand, whether to allow unknown options) should be handled separately.

What I want to do for dart compile js is add options that need to be extracted and passed to the VM running dart2js, and not as one of of the arguments of the dart2js compiler. It seems that I will have to parse the arguments manually.

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

No branches or pull requests

1 participant