swift-argument-parser
swift-argument-parser copied to clipboard
Straightforward, type-safe argument parsing for Swift
It prints a help message when I pass a dash symbol even quoted. **ArgumentParser version:** `0.4.3` **Swift version:** Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55) Target: x86_64-apple-darwin20.5.0 ### Checklist - [x]...
### Description This adds a new `ArgumentSource` type as the projected value for `@Argument`, `@Option`, and `@Flag` types. This way, you can access the original string and location in the...
Just including the argument parser raises my CLI tool binary size from 250KB to about 3MB This seems a _bit_ excessive. **ArgumentParser version:** `main` **Swift version:** Apple Swift version 5.3.2...
My use case is an example from `git`. Potentially linked discussion: https://forums.swift.org/t/supporting-subcommands-with-same-option-name-as-reused-parent-command Let’s consider `git commit` specifically which has the `-C` option to specify a commit from which to reuse...
The default `USAGE` output derives the usage command name from the `ParsableCommand` type name. Now this might be correct or not. The "correct" way would be to always use the...
When I read "Manual Parsing and Testing" I got the impression that `parseAsRoot` would only ever return one of the Math subcommands but I discovered that that wasn't the case...
Option groups are currently just splatted into the rest of the declared arguments for a command. This is sometimes fine, but often it would be nice if option groups were...
I know this one is a little tenuous but I thought I'd throw it out there and if you don't like it, it can be as easily closed as any...
This package uses the `errorCode` property of `CustomNSError` errors as the process exit status. ```swift // MessageInfo.swift:109 case let error as CustomNSError: self = .other(message: error.localizedDescription, exitCode: Int32(error.errorCode)) ``` The...
I have a custom error type that I'm throwing from my command: ``` enum Error: LocalizedError { case foo ... var localizedDescription: String { switch self { case .foo: return...