| 174 | } |
| 175 | |
| 176 | func updateRootUsage() { |
| 177 | defaultUsageFunc := _rootCmd.UsageFunc() |
| 178 | usage := _rootCmd.UsageString() |
| 179 | |
| 180 | _rootCmd.SetUsageFunc(func(cmd *cobra.Command) error { |
| 181 | if cmd != _rootCmd { |
| 182 | return defaultUsageFunc(cmd) |
| 183 | } |
| 184 | |
| 185 | usage = strings.Replace(usage, "Usage:\n cortex [command]\n\nAliases:\n cortex, cx\n\n", "", 1) |
| 186 | usage = strings.Replace(usage, "Available Commands:", "api commands:", 1) |
| 187 | usage = strings.Replace(usage, "\n cluster", "\n\ncluster commands:\n cluster", 1) |
| 188 | usage = strings.Replace(usage, "\n env ", "\n\nother commands:\n env ", 1) |
| 189 | usage = strings.Replace(usage, "\n\nUse \"cortex [command] --help\" for more information about a command.", "", 1) |
| 190 | |
| 191 | cmd.Print(usage) |
| 192 | |
| 193 | return nil |
| 194 | }) |
| 195 | } |
| 196 | |
| 197 | func addVerboseFlag(cmd *cobra.Command) { |
| 198 | cmd.Flags().BoolVarP(&_flagVerbose, "verbose", "v", false, "show additional information (only applies to pretty output format)") |