Use dedent for the kubectl commands

The one side effect is that for the "kubectl help" commands a newline
is prepended to output, which will alter the yaml output.

Here we use dedent to format the code to match the output.

hack/update-generated-docs.sh has been run and the affected files have
been added.

Note: for describe.go we added a period to the end of an output message.
This commit is contained in:
Michael Rubin
2016-05-20 10:49:56 -07:00
parent 77cfa34fd9
commit 760b04e294
44 changed files with 686 additions and 548 deletions

View File

@@ -22,6 +22,7 @@ import (
"net/url"
"github.com/golang/glog"
"github.com/renstrom/dedent"
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/api"
@@ -35,16 +36,17 @@ import (
"k8s.io/kubernetes/pkg/util/term"
)
const (
attach_example = `# Get output from running pod 123456-7890, using the first container by default
kubectl attach 123456-7890
var (
attach_example = dedent.Dedent(`
# Get output from running pod 123456-7890, using the first container by default
kubectl attach 123456-7890
# Get output from ruby-container from pod 123456-7890
kubectl attach 123456-7890 -c ruby-container
# Get output from ruby-container from pod 123456-7890
kubectl attach 123456-7890 -c ruby-container
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
kubectl attach 123456-7890 -c ruby-container -i -t`
# Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
# and sends stdout/stderr from 'bash' back to the client
kubectl attach 123456-7890 -c ruby-container -i -t`)
)
func NewCmdAttach(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {