diff options
author | Debarshi Ray <rishi@fedoraproject.org> | 2019-01-08 12:53:50 +0100 |
---|---|---|
committer | Debarshi Ray <rishi@fedoraproject.org> | 2019-01-08 17:42:37 +0100 |
commit | 867669374c3fdd39f2629e53cbe7430f1bc3e085 (patch) | |
tree | ff744348a1f94cac55771eeb6e36d7ae47579ec7 /cmd | |
parent | 9474b8cea239348d11c913b03b9461afaf663f0b (diff) | |
download | podman-867669374c3fdd39f2629e53cbe7430f1bc3e085.tar.gz podman-867669374c3fdd39f2629e53cbe7430f1bc3e085.tar.bz2 podman-867669374c3fdd39f2629e53cbe7430f1bc3e085.zip |
Add a --workdir option to 'podman exec'
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common.go | 9 | ||||
-rw-r--r-- | cmd/podman/exec.go | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go index 0fc9a6acc..d934c8699 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -28,6 +28,10 @@ var ( Name: "latest, l", Usage: "act on the latest pod podman is aware of", } + WorkDirFlag = cli.StringFlag{ + Name: "workdir, w", + Usage: "Working directory inside the container", + } ) const ( @@ -522,10 +526,7 @@ var createFlags = []cli.Flag{ Name: "volumes-from", Usage: "Mount volumes from the specified container(s) (default [])", }, - cli.StringFlag{ - Name: "workdir, w", - Usage: "Working `directory inside the container", - }, + WorkDirFlag, } func getFormat(c *cli.Context) (string, error) { diff --git a/cmd/podman/exec.go b/cmd/podman/exec.go index c03834dea..073e72e64 100644 --- a/cmd/podman/exec.go +++ b/cmd/podman/exec.go @@ -34,6 +34,7 @@ var ( Usage: "Sets the username or UID used and optionally the groupname or GID for the specified command", }, LatestFlag, + WorkDirFlag, } execDescription = ` podman exec @@ -108,5 +109,5 @@ func execCmd(c *cli.Context) error { envs = append(envs, fmt.Sprintf("%s=%s", k, v)) } - return ctr.Exec(c.Bool("tty"), c.Bool("privileged"), envs, cmd, c.String("user")) + return ctr.Exec(c.Bool("tty"), c.Bool("privileged"), envs, cmd, c.String("user"), c.String("workdir")) } |