Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add "pouch exec" #149

Merged
merged 1 commit into from
Nov 27, 2017
Merged

feature: add "pouch exec" #149

merged 1 commit into from
Nov 27, 2017

Conversation

skoowoo
Copy link
Contributor

@skoowoo skoowoo commented Nov 23, 2017

"exec" is used to execute a new process in container. You can execute a
background process or a interactive process(e.g. bash)

usage:
./pouch exec -ti 12345 /bin/sh
./pouch exec 12345 "/bin/echo hello" , there is quotation mark.

Signed-off-by: skoo87 marckywu@gmail.com

@allencloud
Copy link
Collaborator

Feel so good to read such excellent code. Reviewing...

cli/exec.go Outdated
func (e *ExecCommand) Init(c *Cli) {
e.cli = c
e.cmd = &cobra.Command{
Use: "exec",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add more details about the command usage, like @Letty5411 mentioned in PR #129, https://stackoverflow.com/questions/9725675/is-there-a-standard-format-for-command-line-shell-help-text

usage: app_name [options] required_input required_input2
  options:
    -a, --argument     Does something
    -b required     Does something with "required"
    -c, --command required     Something else
    -d [optlistitem1 optlistitem 2 ... ]     Something with list

"exec" is used to execute a new process in container. You can execute a
background process or a interactive process(e.g. bash)

Signed-off-by: skoo87 <marckywu@gmail.com>
@skoowoo
Copy link
Contributor Author

skoowoo commented Nov 27, 2017

Updated, Now the help info:
Usage:
pouch exec [container] [flags]

Flags:
-d, --detach run process in the backgroud
-h, --help help for exec
-i, --interactive open container's stdin io
-t, --tty allocate a tty device

the format of "pouch exec [container] [flags] " is generated automatically by cobra, seems unable to control it. @allencloud

@allencloud
Copy link
Collaborator

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants