Releases: apple/swift-argument-parser
ArgumentParser 1.1.2
Changes
- CMake builds now always statically link
ArgumentParserToolInfo
. (#424)
Fixes
- When a user provides an array-based option's key (e.g.
--key
) without any values, the error message now correctly describes the problem. (#435)
The 1.1.2 release includes contributions from @compnerd and @KeithBird. Thank you!
ArgumentParser 1.1.1
Fixes
- Moves the platform requirement from the package level down to the new types and protocols with
async
members. This was a source-breaking change in 1.1.0. (#427) - Fixed issues in the CMake build configuration.
ArgumentParser 1.1.0
Additions
- A command's
run()
method now supportsasync
/await
when the command conforms toAsyncParsableCommand
. (#404) - New API for distinguishing between public, hidden, and private arguments and option groups, and a new extended help screen accessible via
--help-hidden
. (#366, #390, and #405 through #413) - You can now override the autogenerated usage string when configuring a command. (#400)
Changes
ArgumentParser
now requires Swift 5.5.
Fixes
- The auto-generated usage string now correctly hides all optional parameters when over the length limit. (#416)
- One
@Option
initializer now has its parameters in the correct order; the incorrect initializer is deprecated. (#391) - Help flags are now correctly captured in
.unconditionalRemaining
argument arrays. - Documentation fixes and improvements.
The 1.1.0 release includes contributions from @keith, @MartinP7r, @McNight, @natecook1000, @rauhul, and @zkiraly. Thank you!
ArgumentParser 1.0.3
Changes
-
When a user provides an incorrect value for an option, an
ArgumentParser
-based program now includes the valid values when possible.$ example --format png Error: The value 'png' is invalid for '--format <format>'. Please provide one of 'text', 'json' or 'csv'.
Fixes
- Resolves an issue with
zsh
custom completions for command names that include a dash. - Improves the generated completions scripts for
fish
. - Resolves issues that prevented building
ArgumentParser
for WebAssembly using SwiftWasm toolchains. - Improved window size handling on Windows.
- Fixed a crash when using
--experimental-dump-help
with commands that provide non-parsed values. - Fixes an issue where subcommands that declare array arguments with the
.unconditionalRemaining
parsing strategy unexpectedly miss arguments, extending the change in #333 to subcommands. (#397) - Corrects the order of an
@Option
initializer's parameters, deprecating the old version. (#391) - Expanded and corrected documentation.
The 1.0.3 release includes contributions from @atierian, @CraigSiemens, @dduan, @floam, @KS1019, @McNight, @mdznr, @natecook1000, @rauhul, and @yonihemi. Thank you!
ArgumentParser 1.0.2
Fixes
- Addresses an issue when building tests under Mac Catalyst.
ArgumentParser 1.0.1
Fixes
- Addresses an issue when compiling under Mac Catalyst.
ArgumentParser 1.0
The 1.0 release marks an important milestone — ArgumentParser
is now source stable!
Changes
ArgumentParser
now provides a DocC documentation catalog, so you can view rendered articles and symbol documentation directly within Xcode.
Fixes
- Parsing works as expected for options with single-dash names that are declared using the
.upToNextOption
parsing strategy.
ArgumentParser 0.5.0
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)
ArgumentParser 0.4.4
Fixes
- Includes a workaround for a runtime crash with certain
OptionGroup
configurations when a command is compiled in release mode.
ArgumentParser 0.4.3
Additions
- Experimental API for hiding
@OptionGroup
-declared properties from the help screen.