Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-301

More consideration for option overriding

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.4
    • None
    • None
    • Any

    Description

      It is currently quite cumbersome to define options where later occurrences override previous ones.

      For one thing, a CommandLine.getLastOptionValue() would help. But this is easy to implement yourself.

      Another pain point are options with optional arguments. Say you have a boolean argument foo that takes an optional argument "true" or "false". If no argument is given, it should be set to true.

      To get the correct value for foo, you first have to find the last occurrence of the option, then check if it has a value and then return either the given value or a default (which is likely different from the default value where the option doesn't occur).

      Attachments

        Activity

          People

            Unassigned Unassigned
            BalzGuenat Balz Guenat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: