storage/vendor/github.com/mattn/go-shellwords
dependabot[bot] c80d439d8d
build(deps): bump github.com/containerd/stargz-snapshotter/estargz
Bumps [github.com/containerd/stargz-snapshotter/estargz](https://github.com/containerd/stargz-snapshotter) from 0.12.0 to 0.12.1.
- [Release notes](https://github.com/containerd/stargz-snapshotter/releases)
- [Commits](https://github.com/containerd/stargz-snapshotter/compare/v0.12.0...v0.12.1)

---
updated-dependencies:
- dependency-name: github.com/containerd/stargz-snapshotter/estargz
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-15 05:54:38 -04:00
..
.travis.yml build(deps): bump github.com/mattn/go-shellwords from 1.0.10 to 1.0.11 2021-01-19 13:25:59 -05:00
LICENSE Switch to go modules 2019-07-09 08:32:22 +02:00
README.md build(deps): bump github.com/mattn/go-shellwords from 1.0.10 to 1.0.11 2021-01-19 13:25:59 -05:00
go.test.sh Bump github.com/mattn/go-shellwords from 1.0.5 to 1.0.6 2019-11-05 12:13:54 +01:00
shellwords.go build(deps): bump github.com/mattn/go-shellwords from 1.0.11 to 1.0.12 2021-06-07 08:30:58 +00:00
util_posix.go build(deps): bump github.com/mattn/go-shellwords from 1.0.10 to 1.0.11 2021-01-19 13:25:59 -05:00
util_windows.go build(deps): bump github.com/mattn/go-shellwords from 1.0.10 to 1.0.11 2021-01-19 13:25:59 -05:00

README.md

go-shellwords

codecov Build Status PkgGoDev ci

Parse line as shell words.

Usage

args, err := shellwords.Parse("./foo --bar=baz")
// args should be ["./foo", "--bar=baz"]
envs, args, err := shellwords.ParseWithEnvs("FOO=foo BAR=baz ./foo --bar=baz")
// envs should be ["FOO=foo", "BAR=baz"]
// args should be ["./foo", "--bar=baz"]
os.Setenv("FOO", "bar")
p := shellwords.NewParser()
p.ParseEnv = true
args, err := p.Parse("./foo $FOO")
// args should be ["./foo", "bar"]
p := shellwords.NewParser()
p.ParseBacktick = true
args, err := p.Parse("./foo `echo $SHELL`")
// args should be ["./foo", "/bin/bash"]
shellwords.ParseBacktick = true
p := shellwords.NewParser()
args, err := p.Parse("./foo `echo $SHELL`")
// args should be ["./foo", "/bin/bash"]

Thanks

This is based on cpan module Parse::CommandLine.

License

under the MIT License: http://mattn.mit-license.org/2017

Author

Yasuhiro Matsumoto (a.k.a mattn)