cmd

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 28 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AskFlagValue = askFlagValue

AskFlagValue returns ok=false when it cannot ask. Tests replace it.

View Source
var AuthCmd = &cobra.Command{
	Use:     "auth",
	Short:   "Sign in and check which credentials are used",
	GroupID: groupSetup,
	Args:    cobra.ArbitraryArgs,
	RunE:    utils.GroupRunE,
}
View Source
var ConfigCmd = &cobra.Command{
	Use:     "config",
	Short:   "Read and write CLI settings",
	GroupID: groupSetup,
	Args:    cobra.ArbitraryArgs,
	RunE:    utils.GroupRunE,
}
View Source
var RootCmd = &cobra.Command{
	Use:   "hostinger-mail",
	Short: "Hostinger Mail API Command Line Interface",
	Long:  "Hostinger Mail API Command Line Interface.\n\nGet started:\n  1. Sign in:        hostinger-mail config set api_token   (or set HOSTINGER_MAIL_API_TOKEN)\n\nOutput is a table on a terminal and JSON when piped; pick one with --format\n(table|json|yaml|tree) or filter it with --jq. Missing arguments and required\nflags are prompted for in a terminal (disable with --no-input). Commands that\ndelete or stop things ask for confirmation (skip with --yes), and --dry-run\nprints the request as curl without sending it.\n\nDocumentation: https://github.com/hostinger/mail-api-cli/tree/main/docs",

	SilenceErrors:     true,
	SilenceUsage:      true,
	PersistentPreRunE: preRun,
}
View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show the current version",
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println(utils.CLIVersion.String(true))
	},
}

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func Question added in v1.5.0

func Question(f *pflag.Flag) string

Question is a short title for common flags, else the trimmed flag help.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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