The new `libimage` package is an attempt to consolidate the code for managing container images and performing operations on them such as pulling, pushing, saving, searching, local lookups, removing etc. Over time, Buildah, CRI-O and Podman diverged with respect to managing container images resulting in a high amount of code duplication rendering the tools harder to maintain (e.g., bug fixes) and harder to extend (e.g., adding new features) than necessary. The desire to share all that code in a common library grew and this is an attempt to address the it. The changes as they are now pass Buildah CI [1]. Once merged into Buildah, I expect follow up changes when migrating Podman over to `libimage`. Miscellaneous changes: * Copy `podman/pkg/signal` to `pkg/signal`. * Copy `buildah/manifests` to `image/manifests`. Note that the unit tests require root privileges. Skip()'s are added when running rootless. Currently excluded from linting. * Copy `buildah/pkg/manifests` to `pkg/manifests`. Currently excluded from linting. * Copy `buildah/pkg/supplemented` to `pkg/supplemented`. Currently excluded from linting. [1] github.com/containers/buildah/pull/3148 Signed-off-by: Valentin Rothberg <rothberg@redhat.com> |
||
|---|---|---|
| .. | ||
| .travis.yml | ||
| LICENSE | ||
| README.md | ||
| go.mod | ||
| go.test.sh | ||
| shellwords.go | ||
| util_posix.go | ||
| util_windows.go | ||
README.md
go-shellwords
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)