Add Support for Rest/Variadic Arguments
Summary
Implement support for variadic/rest arguments to allow commands to accept an unlimited number of positional arguments.
Background
Many CLI tools need to accept a variable number of arguments (e.g., rm file1 file2 file3..., git add file1 file2...). This feature is already mentioned in the project roadmap and would enable more flexible command patterns.
Requirements
Core Functionality
- Variadic arguments: Allow commands to accept unlimited positional arguments after required ones
- Rest argument collection: Collect all remaining arguments into a slice
- Type safety: Maintain type safety with generic support for different argument types
- Validation: Ensure rest arguments can be validated and parsed consistently
API Design Considerations
- Should work with existing argument system
- Maintain backward compatibility
- Support for minimum/maximum argument counts
- Integration with help text generation
Use Cases
// Example: file operations that accept multiple files
myapp copy <source>... <dest>
// Example: command that processes multiple inputs
myapp process <input>...
// Example: mixed required and variadic args
myapp deploy <environment> <service>...
Implementation Requirements
Acceptance Criteria
Additional Notes
This enhancement would significantly improve the flexibility of the CLI framework and is a common requirement for many CLI applications.
Add Support for Rest/Variadic Arguments
Summary
Implement support for variadic/rest arguments to allow commands to accept an unlimited number of positional arguments.
Background
Many CLI tools need to accept a variable number of arguments (e.g.,
rm file1 file2 file3...,git add file1 file2...). This feature is already mentioned in the project roadmap and would enable more flexible command patterns.Requirements
Core Functionality
API Design Considerations
Use Cases
Implementation Requirements
Acceptance Criteria
Additional Notes
This enhancement would significantly improve the flexibility of the CLI framework and is a common requirement for many CLI applications.