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