myip/localip.go

34 lines
821 B
Go

package myip
import (
"github.com/spf13/cobra"
)
var LocalIPCmd = &cobra.Command{
Use: "local",
Short: "short hand for `myip -altc --no-pub`",
Run: func(cmd *cobra.Command, args []string) {
showList = true
showTitle = true
showCell = true
showAll = true
noPub = true
revNoPub, err := cmd.Flags().GetBool("show-public")
if err == nil && revNoPub {
noPub = false
}
Scan()
},
}
func init() {
LocalIPCmd.Flags().StringVarP(&port, "port", "p", "5080", "server port to connect")
LocalIPCmd.Flags().StringVarP(&host, "host", "u", "kumoly.io", "hostname to connect")
LocalIPCmd.Flags().StringVarP(&name, "name", "n", "", "tell the server who you are")
LocalIPCmd.Flags().BoolVar(&secure, "secure", false, "use https")
LocalIPCmd.Flags().BoolP("show-public", "P", false, "show public ip")
}