mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
* added strictmode flag and consts * updated code with strictmode * added flag for retryoperation * updated registry short flag * updated strictmode to ignore errors * fixed command description * cleaned up error/debug logs
18 lines
568 B
Go
18 lines
568 B
Go
package flags
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
type CliRootOpts struct {
|
|
LogLevel string
|
|
HaulerDir string
|
|
IgnoreErrors bool
|
|
}
|
|
|
|
func AddRootFlags(cmd *cobra.Command, ro *CliRootOpts) {
|
|
pf := cmd.PersistentFlags()
|
|
|
|
pf.StringVarP(&ro.LogLevel, "log-level", "l", "info", "Set the logging level (i.e. info, debug, warn)")
|
|
pf.StringVarP(&ro.HaulerDir, "haulerdir", "d", "", "Set the location of the hauler directory (default $HOME/.hauler)")
|
|
pf.BoolVar(&ro.IgnoreErrors, "ignore-errors", false, "Ignore/Bypass errors (i.e. warn on error) (defaults false)")
|
|
}
|