Documentation
¶
Overview ¶
Package config provides subcommands for managing the eng CLI configuration. It allows users to view and modify settings stored in the $HOME/.eng.yaml file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ConfigCmd = &cobra.Command{ Use: "config", Short: "Manage the cli's config file.", Long: `This command is used to facilitate the management of the config file specific to this cli. It should be located at $HOME/.eng.yaml`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("config called") }, }
ConfigCmd represents the base command for all configuration related operations.
View Source
var DotfilesRepoCmd = &cobra.Command{ Use: "dotfiles-repo", Short: "Set dotfiles repo path", Long: `This command sets the path to the local dotfiles repository in the config file.`, Run: func(cmd *cobra.Command, args []string) { log.Start("Checking for dotfile repo path in config file...") config.DotfilesRepo() }, }
DotfilesRepoCmd defines the command for setting the local dotfiles repository path.
View Source
var EmailCmd = &cobra.Command{ Use: "email", Short: "Update config email", Long: `This command should validate and update the email config.`, Run: func(cmd *cobra.Command, args []string) { log.Start("Checking for email in config file...") config.Email() }, }
EmailCmd defines the command for setting the user's email in the configuration.
View Source
var VerboseCmd = &cobra.Command{ Use: "verbose", Short: "Show or set the current verbose flag value", Long: `This command checks, enables, or disables verbose output for this CLI session and saves it to the config file.`, Run: func(cmd *cobra.Command, args []string) { enable, _ := cmd.Flags().GetBool("enable") disable, _ := cmd.Flags().GetBool("disable") if enable && disable { fmt.Println("Cannot enable and disable verbose mode at the same time.") return } if enable { viper.Set("verbose", true) _ = viper.WriteConfig() fmt.Println("Verbose mode enabled and saved to config.") return } if disable { viper.Set("verbose", false) _ = viper.WriteConfig() fmt.Println("Verbose mode disabled and saved to config.") return } verbose := viper.GetBool("verbose") if verbose { fmt.Println("Verbose mode is enabled.") fmt.Println("To disable: eng config verbose --disable") } else { fmt.Println("Verbose mode is disabled.") fmt.Println("To enable: eng config verbose --enable") } }, }
VerboseCmd defines the command for managing the verbose output setting.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.