apple / apple/swift-argument-parser
It should be simpler to support piping input
- Dominant language
- Swift
- Stars
- 3.8k
- Forks
- 411
- Avg merge
- 7d 13h
- Merged PRs (30d)
- 17
Description
**ArgumentParser version:** `1.1.2`.
**Swift version:**
```
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: arm64-apple-macosx12.0
```
### Checklist
- [ ] If possible, I've reproduced the issue using the `main` branch of this package
- [x] I've searched for [existing GitHub issues](https://github.com/apple/swift-argument-parser/issues)
### Steps to Reproduce
a simple argument parser that could take an array of input
```
@main
struct Main: ParsableCommand {
@Argument
var path: [String]
func run() throws {}
}
```
compile this and run it with pipeline `echo **/*.jpg | .build/arm64-apple-macosx/debug/main`
it seems that the stdout is not pass as stdin
### Expected behavior
the stdout from lhs is passed to rhs
### Actual behavior
Describe or copy/paste the behavior you observe.
Contributor guide
Research direction
Start with the reported ParsableCommand entry point using @Argument path: [String], then reproduce the documented echo **/*.jpg | .build/arm64-apple-macosx/debug/main pipeline on the stated Swift and ArgumentParser versions. Determine the intended scope for passing the left-hand command's stdout to the parser and define completion against the expected pipeline behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100