@ -25,6 +25,7 @@ import (
"tailscale.com/cmd/tailscale/cli/ffcomplete"
"tailscale.com/cmd/tailscale/cli/ffcomplete"
"tailscale.com/envknob"
"tailscale.com/envknob"
"tailscale.com/paths"
"tailscale.com/paths"
"tailscale.com/util/slicesx"
"tailscale.com/version/distro"
"tailscale.com/version/distro"
)
)
@ -182,7 +183,7 @@ For help on subcommands, add --help after: "tailscale status --help".
This CLI is still under active development . Commands and flags will
This CLI is still under active development . Commands and flags will
change in the future .
change in the future .
` ) ,
` ) ,
Subcommands : append ( [ ] * ffcli . Command {
Subcommands : nonNilCmds (
upCmd ,
upCmd ,
downCmd ,
downCmd ,
setCmd ,
setCmd ,
@ -214,7 +215,8 @@ change in the future.
debugCmd ,
debugCmd ,
driveCmd ,
driveCmd ,
idTokenCmd ,
idTokenCmd ,
} , maybeAdvertiseCmd ( ) ... ) ,
advertiseCmd ( ) ,
) ,
FlagSet : rootfs ,
FlagSet : rootfs ,
Exec : func ( ctx context . Context , args [ ] string ) error {
Exec : func ( ctx context . Context , args [ ] string ) error {
if len ( args ) > 0 {
if len ( args ) > 0 {
@ -239,6 +241,10 @@ change in the future.
return rootCmd
return rootCmd
}
}
func nonNilCmds ( cmds ... * ffcli . Command ) [ ] * ffcli . Command {
return slicesx . Filter ( cmds [ : 0 ] , cmds , func ( c * ffcli . Command ) bool { return c != nil } )
}
func fatalf ( format string , a ... any ) {
func fatalf ( format string , a ... any ) {
if Fatalf != nil {
if Fatalf != nil {
Fatalf ( format , a ... )
Fatalf ( format , a ... )