cmd/tailscale/cli: prefix all --help usages with "tailscale ...", some tidying

Also capitalises the start of all ShortHelp, allows subcommands to be hidden
with a "HIDDEN: " prefix in their ShortHelp, and adds a TS_DUMP_HELP envknob
to look at all --help messages together.

Fixes #11664

Signed-off-by: Paul Scott <paul@tailscale.com>
This commit is contained in:
Paul Scott
2024-04-04 17:06:09 +01:00
committed by Paul Scott
parent 9da135dd64
commit da4e92bf01
33 changed files with 344 additions and 262 deletions

View File

@ -23,7 +23,7 @@ import (
func exitNodeCmd() *ffcli.Command {
return &ffcli.Command{
Name: "exit-node",
ShortUsage: "exit-node [flags]",
ShortUsage: "tailscale exit-node [flags]",
ShortHelp: "Show machines on your tailnet configured as exit nodes",
LongHelp: "Show machines on your tailnet configured as exit nodes",
Exec: func(context.Context, []string) error {
@ -32,7 +32,7 @@ func exitNodeCmd() *ffcli.Command {
Subcommands: append([]*ffcli.Command{
{
Name: "list",
ShortUsage: "exit-node list [flags]",
ShortUsage: "tailscale exit-node list [flags]",
ShortHelp: "Show exit nodes",
Exec: runExitNodeList,
FlagSet: (func() *flag.FlagSet {
@ -48,13 +48,13 @@ func exitNodeCmd() *ffcli.Command {
return []*ffcli.Command{
{
Name: "connect",
ShortUsage: "exit-node connect",
ShortUsage: "tailscale exit-node connect",
ShortHelp: "connect to most recently used exit node",
Exec: exitNodeSetUse(true),
},
{
Name: "disconnect",
ShortUsage: "exit-node disconnect",
ShortUsage: "tailscale exit-node disconnect",
ShortHelp: "disconnect from current exit node, if any",
Exec: exitNodeSetUse(false),
},