fleet/cmd/fleetctl/flags.go
Martin Angers a3714d2ed9
Add fleetctl debug connection command (#1706)
Adds the `fleetctl debug connection` command to investigate
connection issues to the fleet server.

Closes #1579 .
2021-08-24 08:50:03 -04:00

47 lines
1021 B
Go

package main
import "github.com/urfave/cli/v2"
const (
outfileFlagName = "outfile"
debugFlagName = "debug"
fleetCertificateFlagName = "fleet-certificate"
)
func outfileFlag() cli.Flag {
return &cli.StringFlag{
Name: outfileFlagName,
Value: "",
EnvVars: []string{"OUTFILE"},
Usage: "Path to output file",
}
}
func getOutfile(c *cli.Context) string {
return c.String(outfileFlagName)
}
func debugFlag() cli.Flag {
return &cli.BoolFlag{
Name: debugFlagName,
EnvVars: []string{"DEBUG"},
Usage: "Enable debug http request logging",
}
}
func getDebug(c *cli.Context) bool {
return c.Bool(debugFlagName)
}
func fleetCertificateFlag() cli.Flag {
return &cli.StringFlag{
Name: fleetCertificateFlagName,
EnvVars: []string{"FLEET_CERTIFICATE"},
Usage: "Path of the TLS fleet certificate, can be used to provide additional connection debugging information",
}
}
func getFleetCertificate(c *cli.Context) string {
return c.String(fleetCertificateFlagName)
}