mirror of
https://github.com/ahmetb/kubectx.git
synced 2026-05-05 12:41:44 +00:00
Update help text for kubectx and kubens
- Add description strings from bash scripts to Go help output - Add -r/--readonly usage lines to kubectx help - Reorder help to show -s/-r flags more prominently - Normalize flag separators to comma-space consistently Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30,21 +30,25 @@ func (_ HelpOp) Run(stdout, _ io.Writer) error {
|
||||
}
|
||||
|
||||
func printUsage(out io.Writer) error {
|
||||
help := `USAGE:
|
||||
help := `Manage and switch between kubectl contexts.
|
||||
|
||||
USAGE:
|
||||
%PROG% : list the contexts
|
||||
%PROG% <NAME> : switch to context <NAME>
|
||||
%PROG% - : switch to the previous context
|
||||
%PROG% -s, --shell <NAME> : start a shell scoped to context <NAME>
|
||||
%PROG% -s, --shell : interactively select a context to start a shell
|
||||
%PROG% -r, --readonly <NAME> : start a read-only shell for context <NAME>
|
||||
%PROG% -r, --readonly : interactively select a context for read-only shell
|
||||
%PROG% -c, --current : show the current context name
|
||||
%PROG% -u, --unset : unset the current context
|
||||
%PROG% <NEW_NAME>=<NAME> : rename context <NAME> to <NEW_NAME>
|
||||
%PROG% <NEW_NAME>=. : rename current-context to <NEW_NAME>
|
||||
%PROG% -u, --unset : unset the current context
|
||||
%PROG% -d <NAME> [<NAME...>] : delete context <NAME> ('.' for current-context)
|
||||
%SPAC% (this command won't delete the user/cluster entry
|
||||
%SPAC% referenced by the context entry)
|
||||
%PROG% -s, --shell <NAME> : start a shell scoped to context <NAME>
|
||||
%PROG% -s, --shell : interactively select a context to start a shell
|
||||
%PROG% -h,--help : show this message
|
||||
%PROG% -V,--version : show version`
|
||||
%PROG% -h, --help : show this message
|
||||
%PROG% -V, --version : show version`
|
||||
help = strings.ReplaceAll(help, "%PROG%", selfName())
|
||||
help = strings.ReplaceAll(help, "%SPAC%", strings.Repeat(" ", len(selfName())))
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// kubectx(1) is a utility to manage and switch between kubectl contexts.
|
||||
|
||||
// Copyright 2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -30,7 +30,9 @@ func (_ HelpOp) Run(stdout, _ io.Writer) error {
|
||||
}
|
||||
|
||||
func printUsage(out io.Writer) error {
|
||||
help := `USAGE:
|
||||
help := `Switch between Kubernetes namespaces.
|
||||
|
||||
USAGE:
|
||||
%PROG% : list the namespaces in the current context
|
||||
%PROG% <NAME> : change the active namespace of current context
|
||||
%PROG% <NAME> --force/-f : force change the active namespace of current context (even if it doesn't exist)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// kubens(1) is a utility to switch between Kubernetes namespaces.
|
||||
|
||||
// Copyright 2021 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
Reference in New Issue
Block a user