github.com/devcamcar/cli@v0.0.0-20181107134215-706a05759d18/commands/config.go (about)

     1  package commands
     2  
     3  import (
     4  	"github.com/urfave/cli"
     5  )
     6  
     7  // ConfigCommand returns config cli.command dependant on command parameter
     8  func ConfigCommand(command string) cli.Command {
     9  	var cmds []cli.Command
    10  	switch command {
    11  	case "list":
    12  		cmds = GetCommands(ConfigListCmds)
    13  	case "get":
    14  		cmds = GetCommands(ConfigGetCmds)
    15  	case "configure":
    16  		cmds = GetCommands(ConfigCmds)
    17  	case "unset":
    18  		cmds = GetCommands(ConfigUnsetCmds)
    19  	}
    20  
    21  	return cli.Command{
    22  		Name:        "config",
    23  		ShortName:   "config",
    24  		Usage:       "Manage configurations for apps and functions",
    25  		Aliases:     []string{"cf"},
    26  		ArgsUsage:   "<subcommand>",
    27  		Description: "This command unsets the configuration of created objects ('app' or 'function').",
    28  		Subcommands: cmds,
    29  	}
    30  }