root

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cobra.Command{
	Use:   "usacloud [global options] <command> <sub-command> [options] [arguments]",
	Short: "Usacloud is CLI for manage to resources on the SAKURA Cloud",
	Long:  `CLI to manage to resources on the SAKURA Cloud`,

	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if cmd.Name() == "update-self" {
			return
		}
		once.Do(func() {
			noColor, _ := cmd.PersistentFlags().GetBool("no-color")
			alertNewVersionReleased(noColor)
		})
	},

	RunE: func(cmd *cobra.Command, args []string) error {
		v, err := cmd.Flags().GetBool("version")
		if err != nil {
			return err
		}
		if v {
			cmd.Root().SetArgs([]string{"version"})
			return cmd.Root().Execute()
		}
		return cmd.Help()
	},
}

Command represents the base command when called without any sub-commands

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL