Releases: apple/swift-argument-parser
ArgumentParser 1.6.2
Fixes
- Fixes an ArgumentParser build failure for WASI. (#794)
ArgumentParser 1.6.1
Fixes
- Resolves a source break for clients that have conditional conformances to
ExpressibleByArgumentorParsableArguments. (#792)
ArgumentParser 1.6.0
Additions
- Options with
CaseIterabletypes can now provide help descriptions on a per-value basis. (#647) - New API for accessing the shell and shell version while generating completions. (#680, #690)
- The
generate-docc-referenceplugin generates a DocC reference folder for your CLI tool. (#694, #754, #773)
Changes
- Testing and continuous integration improvements, including migrating to GitHub workflows. (#692, #693, #696, #698, #699, #700, #701, #708, #711, #718, #716, #714, #712, #732, #730, #746, #747, #760)
- The associated closure for
CompletionKind.customnow takes three parameters: the array of shell words currently in use for the completion request, the offset in that array for the word that completions are being requested for, and the prefix of that word that precedes the cursor. In addition, the associated closure can beasync. The single-argument closure version ofCompletionKind.customis deprecated with this release. (#763, #770, #782) ParsableArgumentsandExpressibleByArgumentnow conform toSendableMetatypewhen builing with a minimum Swift 6.2 compiler. (#789)
Fixes
- Significant fixes and improvements across the entire completion script generation system, too numerous to mention here. Please note: numerous longstanding issues still remain in the completion scripts (mainly involving quoting/escaping); they will be fixed over time. A special thanks to @rgoldberg for the investment in completion script quality! (#727, #735, #738, #740, #762, #763, #775, #770, #777, #767)
- Improvements to
generate-manualplugin. (#663, #667) - Error messaging when a user provides a single-dash option is now improved, along with other error reporting improvements. (#728, #744)
- Implementation improvements and fixes for both older and newer versions of Swift. (#676, #707, #705, #720, #666, #724, #731, #766, #685, #729, #736, #741)
- Better capturing of tool configuration in
ToolInfo. (#669, #697) - Documentation improvements. (#657, #678, #743)
The 1.6.0 release includes contributions from @bripeticca, @cg-soft, @compnerd, @dshan4585, @heckj, @natecook1000, @rauhul, @rgoldberg, and @Steelskin. Thank you!
ArgumentParser 1.5.1
ArgumentParser 1.5.0
Additions
- Subcommands can now be grouped into sections, to enable a better help display for commands with many subcommands. (#644)
- Improved unofficial support for Android and riscv64 platforms. (#649, #651)
Fixes
- Command-line completion scripts correctly complete for arguments that are included via option group. (#648)
- Several warnings when compiling with strict concurrency enabled, or in Swift 6 language mode, are now silenced. (#650)
The 1.5.0 release includes contributions from @CraigSiemens, @DougGregor, @finagolfin, @futurejones, and @natecook1000. Thank you!
ArgumentParser 1.4.0
Additions
- Adds support for subcommand aliases via a new
CommandConfiguration.aliasesparameter. Aliases are shown in help text and used during command parsing. For example, a subcommand like "average" from the example "math" tool can be defined with the aliases["avg"]. The resulting subcommand can now be invoked with either ofmath stats averageand ``math stats avg`. See the updated documentation and example for additional details. (#627) - Adds a new API
usageStringtoParsableArgumentsandParsableCommandfor retrieving their usage text, allowing for more flexible construction of error screens. (#634) - Adds support for passing custom arguments to
AsyncParsableCommand.main()with a newstatic func main(_ arguments: [String]?) asyncmethod. (#568)
Fixes
- Removes default parameter values from deprecated CommandConfiguration initializers to prevent them from being selected as overloads. Some niche invalid deprecation warnings should no longer occur. (#636)
The 1.4.0 release includes contributions from @Austinpayne, @dcantah, @KS1019, @natecook1000, @rauhul, and @revolter. Thank you!
ArgumentParser 1.3.1
Changes
- The
CommandConfigrationtype is now designated asSendable. (#615) - The library uses
internalimports instead of@_implementationOnlyannotations in Swift versions where permitted. (#616)
Fixes
@Option- and@Argument-annotated optional properties that use atransformclosure for parsing can now be declared without ambiguity. (#619)- The help flag is now recognized more consistently when a default subcommand has been specified. (#612)
- Options that use the
.upToNextOptionparsing strategy can now recognize an attached value (e.g.--numbers=1 2 3). (#610) - Generated completion scripts for
zshhandle repeatable options correctly. (#614) - Documentation improvements and clarifications. (#607, #611, #617, #621)
- Build improvements for CMake builds. (#606, #608)
The 1.3.1 release includes contributions from @Coeur, @compnerd, @keith, @MaxDesiatov, @mayoff, and @natecook1000. Thank you!
ArgumentParser 1.3.0
Changes
-
The
@Option,@Argument,@Flag, and@OptionGroupproperty wrappers now conditionally conform toSendablewhen the wrapper'sValuetype conforms. With this change, you can markParsableCommandtypes asSendablewhen you want to be able to pass a parsed command across concurrent contexts. (#582)Migration: Users that aren't ready to resolve sendability warnings can add the
@preconcurrencyattribute toimport ArgumentParserstatements. -
To support migration to
Sendableannotation, the minimum Swift version forswift-argument-parserhas been increased to Swift 5.7. Users of older Swift versions will be able to continue using version 1.2.3 of the library. (#582)
Additions
- Help screens now include possible options for
ExpressibleByArgumenttypes with non emptyallValueStrings. Types also conforming toCaseIterabledo not need to manually implementallValueStrings, instead it is derived fromallCases. (#594)
Fixes
- The titles for nested option groups are preserved when embedded into commands without specifying a new title. (#592)
- When wrapping help and error messages, the library now uses the
COLUMNSenvironment variable when set, instead of immediately falling back to 80 columns. (#596) - Bash completion scripts now respect the extensions given in a
.file(...)completion kind. (#590) - Bash completion scripts now properly escape command names that include hyphens. (#573)
- Documentation improvements. (#572, #565, #602)
The 1.2.3 release includes contributions from @Alkenso, @compnerd, @gwynne,
@kennyyork, @natecook1000, @rauhul, @robertmryan, and @vlm. Thank you!
ArgumentParser 1.2.3
Additions
- You can now use ArgumentParser with Musl libc. (#574)
Fixes
- Fixes a bug where single-page manuals did not include command abstracts for
subcommands. (#552) - Fixes a bug where non-optional properties in ParsableCommands could cause
ArgumentParser to crash. You can now include properties like dictionaries in
ParsableCommands without issue. (#554) - Fixes a configuration issue which would cause
ArgumentParserTestHelpersto
fail to link when building for Windows. (#579)
The 1.2.3 release includes contributions from @compnerd, @gwynne,
@MaxDesiatov, @natecook1000, and @rauhul. Thank you!
ArgumentParser 1.2.2
Fixes
- Arguments with the
.allUnrecognizedparsing strategy no longer consume built-in flags like--helpand--version. (#550) - Fixes an issue introduced in version 1.2.0 where properties with underscored names couldn't be parsed. (#548)
- Improves the error message for cases where platform availability causes the synchronous
ParsableCommand.main()static method to be run on anAsyncParsableCommandtype. (#547)