Skip to content

Releases: apple/swift-argument-parser

ArgumentParser 1.8.2

04 Jun 19:03
6a52f32

Choose a tag to compare

Fixes

  • Fixes fish completion scripts for certain flag and option names. (#911)
  • Resolves a build warning by making an implicit Int32 cast explicit on Windows. (#913)

The 1.8.2 release includes contributions from @compnerd and @rgoldberg. Thank you!

ArgumentParser 1.8.1

27 May 13:22
ca37474

Choose a tag to compare

Fixes

  • Reverts a source compatibility regression in the 1.8.0 release, where existing calls to ParsableCommand.parse() and .parseAsRoot() were pre-empted by new async versions. The new asynchronous entry points are now named asyncParse() and asyncParseAsRoot(), respectively. Clients that have already updated their code with the await keyword can resolve the new warning by calling the new APIs or by removing the keyword. (#908)
  • Resolves an issue with the generate-manual plugin that selected the wrong destination for the generated manual. (#910)

ArgumentParser 1.8.0

25 May 17:23
5e0406d

Choose a tag to compare

Additions

  • NameSpecification and its elements now conform to ExpressibleByStringLiteral, allowing simplified option and flag name declarations. For example, @.customLong("hex-output"), .customShort("x") can now be written as "--hex-output -x". (#745)
  • New @Option initializers accept a defaultAsFlag: parameter, creating options that work both as a bare flag (--format) and as an option with a value (--format json). (#830)
  • Custom completion closures for AsyncParsableCommand types now support async/await. (#855)

Changes

  • The minimum Swift version for swift-argument-parser has been updated to Swift 6. Users of older Swift versions can continue using version 1.7.1 of the library. (#882)

Fixes

  • Command aliases now appear in generated man-pages for both single-page and multi-page output. (#891)
  • Declaring @Flag var x: Bool? without an inversion: parameter now produces a useful diagnostic message. (#892)

The 1.8.0 release includes contributions from @bkhouri, @natecook1000, @qflen, @rauhul, and @rgoldberg. Thank you!

ArgumentParser 1.7.1

20 Mar 21:27
626b5b7

Choose a tag to compare

Changes

  • Adds detailed documentation for providing descriptions of enum values. (#825)
  • Adds aliases to the dump-help output. (#813)
  • Improves zsh completions; prevents bash completion cleanup commands from being appended to shell history. (#864, #859)
  • Eliminates deprecation warnings in Examples/math. (#879)

Fixes

  • Fixes build issues in Swift 5.7-5.9. (#874, #875)
  • Fixes --help output for nested subcommands with default subcommands. (#866)
  • Prevents @OptionGroup type names from appearing in help usage strings. (#873)
  • Fixes handling of visibility with nested option groups. (#838)
  • Updates GitHub Actions workflows and streamlines the required checks. (#839, #843, #844, #853, #856, #857, #876, #877)

The 1.7.0 release includes contributions from @bkhouri, @bob-wilson, @jglogan,
@kphrx, @louisunlimited, @natecook1000, @rauhul, @rgoldberg, @salmanmkc,
@stackotter, and @william-laverty. Thank you!

ArgumentParser 1.7.0

17 Dec 18:18
c5d11a8

Choose a tag to compare

Additions

  • Access the state of an ancestor command using the new @ParentCommand property wrapper. (#802)

Fixes

  • Corrects the help display for an case iterable option value type. (#821)
  • Fixes ArgumentParser build failure for WASI (WebAssembly System Interface). (#794)
  • Updates help text for readability in Repeat example and README. (#787)
  • Provides an ambiguity breaker for some ExpressibleByArgument types. (#841)
  • Shell completion script fixes. (#801, #808, #811)

Changes

  • docc: Updates the output to present the string representation of command arguments as a wrapped text block. (#791)
  • Uses Foundation Essentials when possible to reduce binary size on non-Darwin platforms. (#804)
  • CMake: Suppress needlessly alarming messages. (#628)

The 1.7.0 release includes contributions from @bkhouri, @cmcgee1024, @dabrahams, @heckj, @incertum, @kkebo, @Konstantin-Krokhin, @natecook1000, @rauhul, @rgoldberg, and @tshortli. Thank you!

ArgumentParser 1.6.2

10 Oct 16:43

Choose a tag to compare

Fixes

  • Fixes an ArgumentParser build failure for WASI. (#794)

ArgumentParser 1.6.1

01 Jul 15:35
309a47b

Choose a tag to compare

Fixes

  • Resolves a source break for clients that have conditional conformances to ExpressibleByArgument or ParsableArguments. (#792)

ArgumentParser 1.6.0

30 Jun 23:08
852f74c

Choose a tag to compare

Additions

  • Options with CaseIterable types 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-reference plugin 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.custom now 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 be async. The single-argument closure version of CompletionKind.custom is deprecated with this release. (#763, #770, #782)
  • ParsableArguments and ExpressibleByArgument now conform to SendableMetatype when 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-manual plugin. (#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

29 May 03:57

Choose a tag to compare

Fixes

  • Relax the CMake build system to allow implicit linking of Foundation and XCTest when not explicitly given the associated build tree. (#783)

The 1.5.1 release includes a contribution from @compnerd. Thank you!

ArgumentParser 1.5.0

18 Jul 18:04
41982a3

Choose a tag to compare

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!