github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/main/commands/base/root.go (about)

     1  package base
     2  
     3  // RootCommand is the root command of all commands
     4  var RootCommand *Command
     5  
     6  func init() {
     7  	RootCommand = &Command{
     8  		UsageLine: CommandEnv.Exec,
     9  		Long:      "The root command",
    10  	}
    11  }
    12  
    13  // RegisterCommand register a command to RootCommand
    14  func RegisterCommand(cmd *Command) {
    15  	RootCommand.Commands = append(RootCommand.Commands, cmd)
    16  }