Skip to content

Commit

Permalink
Merge pull request kubernetes#10913 from feihujiang/fixSmallNitsForPo…
Browse files Browse the repository at this point in the history
…rtForwardCommand

Fix small nits for kubectl port-forward command
  • Loading branch information
thockin committed Jul 13, 2015
2 parents 7e2d07c + eca0ae0 commit 2d8c9d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/kubectl_port-forward.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Forward one or more local ports to a pod.
Forward one or more local ports to a pod.

```
kubectl port-forward -p POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
kubectl port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
```

### Examples
Expand Down Expand Up @@ -81,6 +81,6 @@ $ kubectl port-forward -p mypod 0:5000
### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra at 2015-05-21 10:33:11.187520496 +0000 UTC
###### Auto generated by spf13/cobra at 2015-07-08 07:53:42.570511034 +0000 UTC

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/kubectl_port-forward.md?pixel)]()
4 changes: 2 additions & 2 deletions pkg/kubectl/cmd/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $ kubectl port-forward -p mypod 0:5000`

func NewCmdPortForward(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "port-forward -p POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]",
Use: "port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]",
Short: "Forward one or more local ports to a pod.",
Long: "Forward one or more local ports to a pod.",
Example: portforward_example,
Expand Down Expand Up @@ -77,7 +77,7 @@ func (*defaultPortForwarder) ForwardPorts(req *client.Request, config *client.Co
func RunPortForward(f *cmdutil.Factory, cmd *cobra.Command, args []string, fw portForwarder) error {
podName := cmdutil.GetFlagString(cmd, "pod")
if len(podName) == 0 {
return cmdutil.UsageError(cmd, "POD is required for exec")
return cmdutil.UsageError(cmd, "POD_NAME is required for port-forward")
}
if len(args) < 1 {
return cmdutil.UsageError(cmd, "at least 1 PORT is required for port-forward")
Expand Down

0 comments on commit 2d8c9d6

Please sign in to comment.