@ -20,45 +20,47 @@ import (
"tailscale.com/tailcfg"
)
var exitNodeCmd = & ffcli . Command {
Name : "exit-node" ,
ShortUsage : "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 {
return errors . New ( "exit-node subcommand required; run 'tailscale exit-node -h' for details" )
} ,
Subcommands : append ( [ ] * ffcli . Command {
{
Name : "list" ,
ShortUsage : "exit-node list [flags]" ,
ShortHelp : "Show exit nodes" ,
Exec : runExitNodeList ,
FlagSet : ( func ( ) * flag . FlagSet {
fs := newFlagSet ( "list" )
fs . StringVar ( & exitNodeArgs . filter , "filter" , "" , "filter exit nodes by country" )
return fs
} ) ( ) ,
} } ,
( func ( ) [ ] * ffcli . Command {
if ! envknob . UseWIPCode ( ) {
return nil
}
return [ ] * ffcli . Command {
{
Name : "connect" ,
ShortUsage : "exit-node connect" ,
ShortHelp : "connect to most recently used exit node" ,
Exec : exitNodeSetUse ( true ) ,
} ,
{
Name : "disconnect" ,
ShortUsage : "exit-node disconnect" ,
ShortHelp : "disconnect from current exit node, if any" ,
Exec : exitNodeSetUse ( false ) ,
} ,
}
} ) ( ) ... ) ,
func exitNodeCmd ( ) * ffcli . Command {
return & ffcli . Command {
Name : "exit-node" ,
ShortUsage : "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 {
return errors . New ( "exit-node subcommand required; run 'tailscale exit-node -h' for details" )
} ,
Subcommands : append ( [ ] * ffcli . Command {
{
Name : "list" ,
ShortUsage : "exit-node list [flags]" ,
ShortHelp : "Show exit nodes" ,
Exec : runExitNodeList ,
FlagSet : ( func ( ) * flag . FlagSet {
fs := newFlagSet ( "list" )
fs . StringVar ( & exitNodeArgs . filter , "filter" , "" , "filter exit nodes by country" )
return fs
} ) ( ) ,
} } ,
( func ( ) [ ] * ffcli . Command {
if ! envknob . UseWIPCode ( ) {
return nil
}
return [ ] * ffcli . Command {
{
Name : "connect" ,
ShortUsage : "exit-node connect" ,
ShortHelp : "connect to most recently used exit node" ,
Exec : exitNodeSetUse ( true ) ,
} ,
{
Name : "disconnect" ,
ShortUsage : "exit-node disconnect" ,
ShortHelp : "disconnect from current exit node, if any" ,
Exec : exitNodeSetUse ( false ) ,
} ,
}
} ) ( ) ... ) ,
}
}
var exitNodeArgs struct {