Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Jun 19, 2014
1 parent 2b56553 commit fef5ab3
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,26 @@ Parse line as shell words.

## Usage

```
```go
args, err := shellwords.Parse("./foo --bar=baz")
// args should be ["./foo", "--bar=baz"]
```

```go
os.Setenv("FOO", "bar")
p := shellwords.NewParser()
p.ParseEnv = true
args, err := p.Parse("./foo $FOO")
// args should be ["./foo", "bar"]
```

```go
p := shellwords.NewParser()
p.ParseBacktick = true
args, err := p.Parse("./foo `echo SHELL`")
// args should be ["./foo", "/bin/bash"]
```

# License

under the MIT License: http://mattn.mit-license.org/2014
Expand Down

0 comments on commit fef5ab3

Please sign in to comment.