Skip to content

Commit

Permalink
Merge pull request #247 from oclif/mdonnalley/doc-stdin-args
Browse files Browse the repository at this point in the history
fix: document that args read from stdin
  • Loading branch information
mdonnalley authored Jun 10, 2024
2 parents ff35dc6 + ab804c0 commit 961ca98
Show file tree
Hide file tree
Showing 3 changed files with 1,449 additions and 599 deletions.
10 changes: 10 additions & 0 deletions docs/args.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,13 @@ export class MyCLI extends Command {
this.log(`running my command with args: ${argv[0]}, ${argv[1]}`)
}
}
```

Arguments can also be piped via stdin. This is particularly useful when creating scripts with your CLI commands. For example:

```
$ echo arg1 | mycli
running my command with args: arg1
```

This can behavior can be disabled on an argument by setting the `ignoreStdin` property to `true` on the argument's definition.
4 changes: 2 additions & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"docusaurus": "docusaurus"
},
"dependencies": {
"@docusaurus/core": "^3.2.1",
"@docusaurus/preset-classic": "^3.2.1",
"@docusaurus/core": "^3.4.0",
"@docusaurus/preset-classic": "^3.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
Loading

0 comments on commit 961ca98

Please sign in to comment.