apple / apple/swift-argument-parser

Showing the accepted input type

Open
#8 7 comments 11 reactions 0 assignees View on GitHub
enhancement
Dominant language
Swift
Stars
3.8k
Forks
411
Avg merge
7d 14h
Merged PRs (30d)
15

Description

Like [the blog post](https://swift.org/blog/argument-parser/) mentions:

> Because `highValue` is defined as an `Int`, only valid inputs are recognized, with no manual parsing or casting necessary on your part:

```
> random ZZZ
Error: The value 'ZZZ' is invalid for ''
Usage: random
```

Would it be possible to give an indication that an `Int` is expected rather than the invalid `String`?

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the invalid `ZZZ` input behavior from the issue and trace the argument-validation and error-formatting entry points; done means the diagnostic indicates that an `Int` is expected while preserving the shown usage output.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.