mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 18:09:51 +00:00
* added env variables for haulerDir/tempDir
* updated hauler directory for the install script
* cleanup/fixes for install script
* updated variables based on feedback
* revert "updated variables based on feedback"
* reverts commit 54f7a4d695
* minor restructure to root flags
* updated logic to include haulerdir flag
* cleaned up/formatted new logic
* more cleanup and formatting
16 lines
427 B
Go
16 lines
427 B
Go
package flags
|
|
|
|
import "github.com/spf13/cobra"
|
|
|
|
type CliRootOpts struct {
|
|
LogLevel string
|
|
HaulerDir string
|
|
}
|
|
|
|
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)")
|
|
}
|