MCPcopy Index your code
hub / github.com/cortexlabs/cortex / updateRootUsage

Function updateRootUsage

cli/cmd/root.go:176–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

174}
175
176func 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
197func addVerboseFlag(cmd *cobra.Command) {
198 cmd.Flags().BoolVarP(&_flagVerbose, "verbose", "v", false, "show additional information (only applies to pretty output format)")

Callers 1

ExecuteFunction · 0.85

Calls 1

PrintMethod · 0.45

Tested by

no test coverage detected