CmdConnect is used by agnhost Cobra.
var CmdConnect = &cobra.Command{ Use: "connect [host:port]", Short: "Attempts a TCP, UDP or SCTP connection and returns useful errors", Long: `Tries to open a TCP, UDP or SCTP connection to the given host and port. On error it prints an error message prefixed with a specific fixed string that test cases can check for: * UNKNOWN - Generic/unknown (non-network) error (eg, bad arguments) * TIMEOUT - The connection attempt timed out * DNS - An error in DNS resolution * REFUSED - Connection refused * OTHER - Other networking error (eg, "no route to host")`, Args: cobra.ExactArgs(1), Run: main, }