INNER CODE UNIT · Go

RootCmd

Netis/cloud-probe · cpctl/cmd/base.go:109

func RootCmd() *cobra.Command {
	return rootCmd
}

func init() {
	pf := rootCmd.PersistentFlags()
	pf.StringVarP(&Globals.Unix, "unix", "u", "",
		"path to cpworker unix control socket, e.g. /var/run/cloud-probe/cpworker.sock")
	pf.StringVarP(&Globals.Format, "format", "f", FormatText,
		"output format: text|jsonl (ndjson accepted as alias for jsonl)")
	pf.DurationVarP(&Globals.Timeout, "timeout", "W", 3*time.Second,
		"per-RPC timeout")
}

// requireUnix returns an error if --unix was not set. Used by
// commands that must talk to a cpworker.
func requireUnix() error {
	if Globals.Unix == "" {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…