2021-07-06 11:27:54 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
const configPathFlag = "path"
|
|
|
|
|
|
|
|
var (
|
|
|
|
// RootCmd is a root command of config section.
|
|
|
|
RootCmd = &cobra.Command{
|
|
|
|
Use: "config",
|
2022-06-28 06:03:52 +00:00
|
|
|
Short: "Section for neofs-adm config related commands",
|
2021-07-06 11:27:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
initCmd = &cobra.Command{
|
|
|
|
Use: "init",
|
2022-06-28 06:03:52 +00:00
|
|
|
Short: "Initialize basic neofs-adm configuration file",
|
2021-07-06 11:27:54 +00:00
|
|
|
Example: `neofs-adm config init
|
|
|
|
neofs-adm config init --path .config/neofs-adm.yml`,
|
|
|
|
RunE: initConfig,
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
RootCmd.AddCommand(initCmd)
|
|
|
|
|
|
|
|
initCmd.Flags().String(configPathFlag, "", "path to config (default ~/.neofs/adm/config.yml)")
|
|
|
|
}
|