root.go 349 B

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