swift-argument-parser icon indicating copy to clipboard operation
swift-argument-parser copied to clipboard

Straightforward, type-safe argument parsing for Swift

Results 121 swift-argument-parser issues
Sort by recently updated
recently updated
newest added

I have a command line tool that invokes another tool, and I'd like to allow the user to pass arguments for the underlying tool. In other words: ``` my-tool my-argument...

Flags can be mutually exclusive, but there isn't a way to do that for options. e.g. you can't have `[--arch | --target ]` Ideally these could be nested like `[[--one...

Currently it's only possible to use initial value if the property type is non-`Optional`. I'd like to use environment variable as a fallback value for a command line argument (similar...

### Description Currently it's only possible to use initial value if the property type has a non-`Optional` type (by means of the `wrappedValue` parameter). In some cases we might need...

This PR adds support for conditionally expanding argument and subcommand synopses to reflect supported values when there are multiple values and their combined length is not overly onerous. To use...

Adds a new static main function to `AsyncParsableCommand` to allow users to manually pass in arguments. The new functions behaves identically to the version found in `ParsableCommand` (see: https://github.com/apple/swift-argument-parser/blob/main/Sources/ArgumentParser/Parsable%20Types/ParsableCommand.swift#L126). This...

When using an AsyncParsableCommand with @main, the command-line-tool exits without running the `run() async` function and prints the help log. Note: `run()` without `async` runs the function. **ArgumentParser version:** `1.2.0`...

bug

Hi, it's always felt a bit weird to me to have to manually hardcode and maintain the version number as part of my main command, e.g. ```swift @main struct Command:...

enhancement

### Description This adds the `shouldUseExecutableName` property to `CommandConfiguration`, allowing the command name to be derived from the executable's file name. The property defaults to false, both because subcommands using...

Replace this paragraph with a short description of the incorrect incorrect behavior. If this is a regression, please note the last version that the behavior was correct in addition to...