Reliable argument handling
Open
- Dominant language
- Go
- Stars
- 52
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
Currently, we allow users to mix optional, variadic, and required arguments. In order of preference:
1. make this impossible (see below)
2. check at start
3. check when calling the command
We currently do *none* of these. Instead, we have some weird logic in CheckArguments where we stop filling in optional arguments once we realize we'll need the rest to fill in required arguments.
---
Preferred solution:
```go
type Command struct {
Arguments Arguments
// ...
}
type Arguments struct {
Required []Argument
Optional []Argument
Variadic Argument
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.