Bug 1248463 - wrong exec command help
wrong exec command help
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Fabiano Franz
Yan Du
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-30 07:04 EDT by Aleksandar Kostadinov
Modified: 2016-05-12 13:11 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:11:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Aleksandar Kostadinov 2015-07-30 07:04:32 EDT
Description of problem:

> $ oc help exec
> Execute a command in a container.
> 
> Usage:
>   oc exec POD -c CONTAINER -- COMMAND [args...] [options]

While it should be:
> oc exec POD -c CONTAINER [options] -- COMMAND [args...]

Version-Release number of selected component (if applicable):
1.0.2
Comment 1 Fabiano Franz 2016-01-11 10:16:24 EST
Fixed in https://github.com/openshift/origin/pull/6607
Comment 2 openshift-github-bot 2016-01-12 09:45:59 EST
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/a8939d6a819cfd8680764c71e1e5185f02eded09
Bug 1248463 - fixes exec help
Comment 3 Aleksandar Kostadinov 2016-01-13 02:12:05 EST
>    # oc version
>    oc v1.1-761-g052c08b
>    kubernetes v1.1.0-origin-1107-g4c8e6f4
>     
>     
>    # oc help exec
>    Execute a command in a container
>     
>    Usage:
>      oc exec POD [-c CONTAINER] [options] -- COMMAND [args...] [options]
>     
>    Examples:
>      # Get output from running 'date' in ruby-container from pod 123456-7890
>      $ oc exec -p 123456-7890 -c ruby-container date
>     
>      # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780 and sends stdout/stderr from 'bash' back to the client
>      $ oc exec -p 123456-7890 -c ruby-container -i -t -- bash -il
>     
>    Options:
>      -c, --container='': Container name. If omitted, the first container in the pod will be chosen
>      -p, --pod='': Pod name
>      -i, --stdin=false: Pass stdin to the container
>      -t, --tty=false: Stdin is a TTY
>     
>    Use "oc options" for a list of global command-line options (applies to all commands).

You can see above that `[options]` is still listed after `--`. `oc` cannot accept options as described in help after `--`. This can confuse users non-savvy in linux shell.
Comment 4 Fabiano Franz 2016-03-10 08:41:57 EST
Fixed the usage in https://github.com/openshift/origin/pull/7895.
Comment 5 Yan Du 2016-03-21 02:02:59 EDT
Test on latest env, issue have been fixed

# oc version
oc v3.2.0.5
kubernetes v1.2.0-36-g4a3f9c5


# oc help exec
Execute a command in a container

Usage:
  oc exec [options] POD [-c CONTAINER] -- COMMAND [args...]

Examples:
  # Get output from running 'date' in ruby-container from pod 123456-7890
  $ oc exec -p 123456-7890 -c ruby-container date

  # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780 and sends stdout/stderr from 'bash' back to the client
  $ oc exec -p 123456-7890 -c ruby-container -i -t -- bash -il

Options:
  -c, --container='': Container name. If omitted, the first container in the pod will be chosen
  -p, --pod='': Pod name
  -i, --stdin=false: Pass stdin to the container
  -t, --tty=false: Stdin is a TTY

Use "oc options" for a list of global command-line options (applies to all commands).

Note You need to log in before you can comment on or make changes to this bug.