Skip to content

Extra documentation: tricks and traps with options with optional values #1315

Closed
@shadowspawn

Description

@shadowspawn

We could add a separate page, outside the README, going into details about potential challenges using options with optional values. They seem quite attractive and the README used to use them more than options with require values! In practice, they are a bit tricky and aren't a free choice.

  • parsing ambiguity when use option as boolean flag but also operands and subcommands
  • possible work-arounds
    • dash-dash (for expert users)
    • tell users always dash-dash before operands
    • tell users options come after operands
    • convert arguments into options! Options work pretty nicely together.
  • conflict between short flag with value, and combined short flags with optional values. Work-around code to restore pre-Commander v5.0 parsing for people who prefer short-flag combining to short-flag+value.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsREADME (or other docs) could be improved

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions