config

package
v0.0.0-...-8cb0cac Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigCmd = &cobra.Command{
	Use:   "config",
	Short: "Manage configuration",
	Run: func(cmd *cobra.Command, args []string) {
		isCopyConfigFile, err := cmd.Flags().GetBool("copy")
		if err != nil {
			fmt.Printf("Error: %v\n", err)
			os.Exit(1)
		}

		if isCopyConfigFile {
			if err := CopyDefaultConfigFile(); err == nil {
				fmt.Println("Copy the default config file to the local config directory successfully.")
			} else {
				fmt.Printf("Error: %v\n", err)
			}
		}
	},
}

ConfigCmd represents the config command

Functions

func CopyDefaultConfigFile

func CopyDefaultConfigFile() error

CopyDefaultConfigFile copies the default configuration file to the user's home directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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