mirror of
https://github.com/empayre/fleet.git
synced 2024-11-07 09:18:59 +00:00
4cfcb1b084
This is intended to upgrade to the new API without changing fleetctl functionality.
34 lines
594 B
Go
34 lines
594 B
Go
package main
|
|
|
|
import "github.com/urfave/cli/v2"
|
|
|
|
const (
|
|
outfileFlagName = "outfile"
|
|
debugFlagName = "debug"
|
|
)
|
|
|
|
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)
|
|
}
|