Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.17.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigCmd = &cobra.Command{
	Use:   "config",
	Short: "Manage the cli's config file 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")
	},
}
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()
	},
}
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()
	},
}
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")
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL