program

package
v0.0.0-...-5037c0d Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "unknown"

Functions

This section is empty.

Types

type Options

type Options struct {
	Version bool `help:"Show program version"`

	Debug        bool        `group:"Info" help:"Show debugging information"`
	OutputFormat string      `group:"Info" enum:"auto,jsonl,terminal" default:"auto" help:"How to show program output (auto|terminal|jsonl)"`
	Quiet        bool        `group:"Info" help:"Be less verbose than usual"`
	Cmd1         Subcommand1 `cmd:""`
	Cmd2         Subcommand2 `cmd:""`
}

Options is the structure of program options

func (*Options) AfterApply

func (program *Options) AfterApply() error

AfterApply runs after the options are parsed but before anything runs

func (*Options) Parse

func (program *Options) Parse(args []string) (*kong.Context, error)

Parse calls the CLI parsing routines

func (*Options) Run

func (program *Options) Run() error

Run runs the program

type Subcommand1

type Subcommand1 struct {
	Dir1 string `group:"dir" help:"get a directory" type:"existingdir" default:"dir1"`
}

type Subcommand2

type Subcommand2 struct {
	Dir2 string `group:"dir" help:"get a directory" type:"existingdir" default:"dir2"`
}

type VersionCmd

type VersionCmd struct{}

VersionCmd prints the program version

func (*VersionCmd) Run

func (v *VersionCmd) Run(program *Options) error

Jump to

Keyboard shortcuts

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