akme/get-closer

View on GitHub
cmd/tcp.go

Summary

Maintainability
A
0 mins
Test Coverage
// Copyright © 2019 Vyacheslav Akhmetov <iam@itaddict.ru>

package cmd

import (
    "github.com/spf13/cobra"
)

// tcpCmd represents the tcp command
var tcpCmd = &cobra.Command{
    Use:   "tcp",
    Short: "Measuring time for connecting to open TCP port.",
    Long:  `Measuring time for connecting to open TCP port.`,
    Run:   startMeasurements,
}

func init() {
    rootCmd.AddCommand(tcpCmd)

    // Here you will define your flags and configuration settings.

    // Cobra supports Persistent Flags which will work for this command
    // and all subcommands, e.g.:
    // tcpCmd.PersistentFlags().String("foo", "", "A help for foo")
    tcpCmd.PersistentFlags().IntVarP(&tcpPort, "port", "p", 80, "set tcp port")
    // Cobra supports local flags which will only run when this command
    // is called directly, e.g.:
    // tcpCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}