Skip to content

ArgumentParser 0.5.0

Compare
Choose a tag to compare
@natecook1000 natecook1000 released this 03 Sep 17:32
· 158 commits to main since this release
6b2aa27

Additions

  • When a user doesn't provide a required argument, the error message now includes that argument's help text. (#324)
  • Command-line tools built with ArgumentParser now include an experimental flag to dump command/argument/help information as JSON: --experimental-dump-help. (#310)

Changes

  • All public enumerations are now structs with static properties, to make compatibility with future additions simpler.

Fixes

  • Array properties defined as @Option with the .upToNextOption parsing strategy now include all provided values. (#304) In the example below, all four values are now included in the resulting array, where only the last two were included in previous releases:

    struct Example: ParsableCommand {
        @Option(parsing: .upToNextOption)
        var option: String
    }
    $ example --option one two --option three four
    
  • When a command defines an array property as an @Argument with the .unconditionalRemaining parsing strategy, option and flag parsing now stops at the first positional argument or unrecognized flag. (#333)

  • Completion scripts correctly use customized help flags. (#308)

  • Fixes errors with bash custom completion arguments and the executable path. (#320, #323)

  • Fixes the behavior when a user specifies both the help subcommand and a help flag. (#309)

  • A variety of internal improvements. (#315, #316, #321, #341)