cmd

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "print ipfool version",
	Run: func(cmd *cobra.Command, args []string) {
		info, ok := debug.ReadBuildInfo()
		if !ok {
			panic("could not read build info")
		}
		iplibVersion := "unknown"
		for _, mod := range info.Deps {
			if mod.Path == "github.com/c-robinson/iplib/v2" {
				iplibVersion = mod.Version
			}
		}

		fmt.Printf("ipfool %s, using iplib %s\n", info.Main.Version, iplibVersion)
		if versionExtendedFlag {
			viewExtendedVersion(info)
		}
	},
}

Functions

func Execute

func Execute()

Execute runs rootCmd and needs normal printer in case onIntialize fails and no printer is available

func ViewIPAddress

func ViewIPAddress(ipnet iplib.Net)

Types

type Stamp

type Stamp struct {
	InfoGoVersion string
	InfoCompiler  string
	InfoGOARCH    string
	InfoGOOS      string
	InfoBuildTime string
	VCSRevision   string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL