Skip to content

No clean way to handle unknown options #722

Open
@rakudrama

Description

@rakudrama

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions