apple / apple/swift-argument-parser

It should be simpler to support piping input

Open
#447 7 comments 2 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.