automation-tests/common/vendor/github.com/mattn/go-shellwords
dependabot-preview[bot] 4ab2941105 Bump github.com/containers/storage from 1.24.5 to 1.25.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.24.5 to 1.25.0.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.24.5...v1.25.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-04 05:09:54 -05:00
..
.travis.yml Bump github.com/containers/storage from 1.24.5 to 1.25.0 2021-02-04 05:09:54 -05:00
LICENSE add libpod.conf to containers.conf 2019-12-06 15:55:47 -05:00
README.md Bump github.com/containers/storage from 1.24.5 to 1.25.0 2021-02-04 05:09:54 -05:00
go.mod pkg/capabilities 2020-02-18 15:58:19 +01:00
go.test.sh add libpod.conf to containers.conf 2019-12-06 15:55:47 -05:00
shellwords.go Bump github.com/containers/storage from 1.24.5 to 1.25.0 2021-02-04 05:09:54 -05:00
util_posix.go Bump github.com/containers/storage from 1.24.5 to 1.25.0 2021-02-04 05:09:54 -05:00
util_windows.go Bump github.com/containers/storage from 1.24.5 to 1.25.0 2021-02-04 05:09:54 -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)