cmd

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "Initializes an Ironstar project",
	Long:  "Initializes an Ironstar project by creating configuration files in the current working directory",
	Run: func(cmd *cobra.Command, args []string) {
		err := services.InitializeIronstarProject()
		if err != nil {
			if err != api.ErrIronstarAPICall {
				fmt.Println()
				color.Red(err.Error())
			}

			os.Exit(1)
		}

		color.Green("Successfully created the required Ironstar configuration files!")
		fmt.Println()
		color.Green("Run `iron subscription link [subscription-name]` to link this project to a remote Ironstar subscription")
	},
}

InitCmd - `iron init`

View Source
var LoginCmd = &cobra.Command{
	Use:   "login [email]",
	Short: "Authenticate for the Ironstar API",
	Long:  "Authenticate and store credentials for use against the Ironstar API",
	Run: func(cmd *cobra.Command, args []string) {
		err := auth.IronstarAPILogin(args, flags.Acc)
		if err != nil {
			if err != api.ErrIronstarAPICall {
				fmt.Println()
				color.Red(err.Error())
			}

			os.Exit(1)
		}
	},
}

LoginCmd - `iron auth login`

View Source
var LogoutCmd = &cobra.Command{
	Use:   "logout [email]",
	Short: "Logout from your Ironstar API session",
	Long:  "Logout from your Ironstar API session. This destroys the session token in the Ironstar system",
	Run: func(cmd *cobra.Command, args []string) {
		err := auth.Logout(args, flags.Acc)
		if err != nil {
			if err != api.ErrIronstarAPICall {
				fmt.Println()
				color.Red(err.Error())
			}

			os.Exit(1)
		}
	},
}

LogoutCmd - `iron auth logout`

View Source
var UpgradeCmd = &cobra.Command{
	Use:   "upgrade",
	Short: "Upgrade to the latest version of the Ironstar CLI",
	Long:  "Upgrade to the latest version of the Ironstar CLI",
	Run: func(cmd *cobra.Command, args []string) {
		err := version.Upgrade(flags.Acc)
		if err != nil {
			if err != api.ErrIronstarAPICall {
				fmt.Println()
				color.Red(err.Error())
			}

			os.Exit(1)
		}
	},
}

UpgradeCmd - `iron upgrade`

View Source
var VersionCmd = &cobra.Command{
	Use:   "version [version]",
	Short: "Print Ironstar CLI version information",
	Long:  "Print Ironstar CLI version information including 'Build Date', 'Compiler' and 'Platform'",
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) == 0 || args[0] == "" {
			version.Display()

			return
		}

		err := version.Select(args[0], flags.Acc)
		if err != nil {
			if err != api.ErrIronstarAPICall {
				fmt.Println()
				color.Red(err.Error())
			}

			os.Exit(1)
		}
	},
}

VersionCmd - `iron version`

Functions

func Execute

func Execute()

Execute - Root executable

func RootCmd

func RootCmd() *cobra.Command

RootCmd will setup and return the root command

Types

This section is empty.

Jump to

Keyboard shortcuts

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