cli

package
v0.0.0-...-5faa4f6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Version Flag = "version"
	Help         = "help"
	Verbose      = "verbose"
)

Variables

This section is empty.

Functions

func DownloadJdk

func DownloadJdk(homeDir string, client *http.Client, logger *log.Logger, attempt int) (string, error)

func HandleAppError

func HandleAppError(projectDir string, err error) (reportLog bool)

func HandleArgsValidation

func HandleArgsValidation(err error)

func PrintCommands

func PrintCommands(projectDir string, javaHomeSet bool, jdkPath string)

func WriteUsage

func WriteUsage(w io.Writer)

Types

type Arg

type Arg struct {
	// contains filtered or unexported fields
}

type Args

type Args struct {
	Flags       []string
	Command     string
	CommandArgs []string
}

func ParseArgs

func ParseArgs(args []string) *Args

type Command

type Command string
const (
	NewCommand     Command = "new"
	VersionCommand Command = "version"
	HelpCommand    Command = "help"
)

type CommandError

type CommandError struct {
	Command Command
}

func (CommandError) Error

func (e CommandError) Error() string

type Error

type Error struct {
	Kind ErrorKind
	Err  error
}

func (Error) Error

func (e Error) Error() string

type ErrorKind

type ErrorKind int
const (
	NoCommandError ErrorKind = iota
	CommandNotFoundError
	WrongNumberOfArgumentsError
	UnrecognizedFlagsError
)

type Flag

type Flag string

type Input

type Input struct {
	Command     Command
	CommandArgs []string
	Verbose     bool
}

func ProcessArgs

func ProcessArgs(args *Args) (*Input, error)

type Options

type Options struct {
	Verbose bool
}

type UnrecognizedFlags

type UnrecognizedFlags []string

func (UnrecognizedFlags) Error

func (f UnrecognizedFlags) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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