forked from TrueCloudLab/frostfs-node
[#666] cmd/neofs-adm: Initial app structure with config init
command
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
24d1725cc8
commit
d189d60925
5 changed files with 269 additions and 0 deletions
29
cmd/neofs-adm/internal/modules/config/root.go
Normal file
29
cmd/neofs-adm/internal/modules/config/root.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const configPathFlag = "path"
|
||||
|
||||
var (
|
||||
// RootCmd is a root command of config section.
|
||||
RootCmd = &cobra.Command{
|
||||
Use: "config",
|
||||
Short: "Section for neofs-adm config related commands.",
|
||||
}
|
||||
|
||||
initCmd = &cobra.Command{
|
||||
Use: "init",
|
||||
Short: "Initialize basic neofs-adm configuration file.",
|
||||
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)")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue