Skip to content

Commit 9719ca6

Browse files
committed
Add usage example to README
1 parent bca6ab2 commit 9719ca6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ args, err := p.Parse("./foo `echo $SHELL`")
4242
// args should be ["./foo", "/bin/bash"]
4343
```
4444

45+
```go
46+
p := shellwords.NewParser()
47+
p.ParseComment = true
48+
args, err := p.Parse("./foo # comment")
49+
// args should be ["./foo"]
50+
```
51+
4552
# Thanks
4653

4754
This is based on cpan module [Parse::CommandLine](https://metacpan.org/pod/Parse::CommandLine).

0 commit comments

Comments
 (0)