Execute register all commands and executes the command.
()
| 54 | |
| 55 | // Execute register all commands and executes the command. |
| 56 | func Execute() error { |
| 57 | commands := []Command{ |
| 58 | &versionCmd{}, |
| 59 | &initCmd{}, |
| 60 | &updateCmd{}, |
| 61 | &createCmd{}, |
| 62 | &configureCmd{}, |
| 63 | &installCmd{}, |
| 64 | &removeCmd{}, |
| 65 | &integrateCmd{}, |
| 66 | &deployCmd{}, |
| 67 | &treeCmd{}, |
| 68 | &cleanCmd{}, |
| 69 | &autoremoveCmd{}, |
| 70 | &reverseCmd{}, |
| 71 | &searchCmd{}, |
| 72 | &setupCmd{}, |
| 73 | } |
| 74 | |
| 75 | // Create celer but init it in command. |
| 76 | celer := configs.NewCeler() |
| 77 | |
| 78 | // Register commands. |
| 79 | for _, cmd := range commands { |
| 80 | rootCmd.AddCommand(cmd.Command(celer)) |
| 81 | } |
| 82 | |
| 83 | return rootCmd.Execute() |
| 84 | } |