mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 10:48:15 +00:00
Fix md generation for kubectl docs
Display usage string, not long help, as code, remove angle brackets from output (.md interprets as tags and hides).
This commit is contained in:
@@ -35,18 +35,28 @@ type viewOptions struct {
|
||||
merge util.BoolFlag
|
||||
}
|
||||
|
||||
const (
|
||||
view_long = `displays merged .kubeconfig settings or a specified .kubeconfig file.
|
||||
|
||||
You can use --output=template --template=TEMPLATE to extract specific values.`
|
||||
view_example = `// Show merged .kubeconfig settings.
|
||||
$ kubectl config view
|
||||
|
||||
// Show only local ./.kubeconfig settings
|
||||
$ kubectl config view --local
|
||||
|
||||
// Get the password for the e2e user
|
||||
$ kubectl config view -o template --template='{{ index . "users" "e2e" "password" }}'`
|
||||
)
|
||||
|
||||
func NewCmdConfigView(out io.Writer, pathOptions *pathOptions) *cobra.Command {
|
||||
options := &viewOptions{pathOptions: pathOptions}
|
||||
|
||||
cmd := &cobra.Command{
|
||||
Use: "view",
|
||||
Short: "displays merged .kubeconfig settings or a specified .kubeconfig file.",
|
||||
Long: "displays merged .kubeconfig settings or a specified .kubeconfig file.",
|
||||
Example: `// Show merged .kubeconfig settings.
|
||||
$ kubectl config view
|
||||
|
||||
// Show only local ./.kubeconfig settings
|
||||
$ kubectl config view --local`,
|
||||
Use: "view",
|
||||
Short: "displays merged .kubeconfig settings or a specified .kubeconfig file.",
|
||||
Long: view_long,
|
||||
Example: view_example,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
options.complete()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user