commands

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root struct {
	Init      Init             `cmd:"init" short:"i" help:"Setup a new Go module or application"`
	Build     Build            `cmd:"build" short:"b" help:"Build the Go application"`
	Run       Run              `cmd:"run" short:"r" help:"Run the Go application"`
	Test      Test             `cmd:"test" short:"t" help:"Run unit tests"`
	Uninstall Uninstall        `cmd:"uninstall" short:"u" help:"Uninstall a 'go install' app."`
	Exec      Do               `cmd:"exec" short:"x" help:"Run a script from the manifest/package"`
	Version   kong.VersionFlag `name:"version" short:"v" help:"Display the QuikGo version."`
}

Functions

This section is empty.

Types

type Build

type Build struct {
	Bundle      []string `name:"bundle" short:"b" type:"string" help:"Bundle the application into a tarball/zipball" enum:"zip,tar"`
	OS          []string `name:"os" type:"string" help:"The operating system(s) to build for (any options from 'go tool dist list' is valid)"`
	WASM        bool     `name:"wasm" type:"bool" help:"Output a web assembly (OS is ignored when this option is true)"`
	Output      string   `name:"output" short:"o" type:"string" help:"Output file name"`
	Tips        bool     `name:"tips" short:"t" type:"bool" help:"Display tips in the generated commands"`
	Minify      bool     `name:"minify" short:"m" type:"bool" help:"Set ldflags to strip debugging symbols and remove DWARF generations"`
	Shrink      bool     `name:"shrink" short:"s" type:"bool" help:"Set gccgoflags to strip debugging symbols and remove DWARF generations"`
	Compress    bool     `name:"compress" short:"c" type:"bool" help:"Compress with UPX"`
	Tiny        bool     `name:"tiny" type:"bool" help:"Use tinygo (if available) instead of go to build."`
	DryRun      bool     `name:"dry-run" short:"d" type:"bool" help:"Display the command without executing it."`
	NoWork      bool     `name:"nowork" type:"bool" help:"Set GOWORK=off when building"`
	Update      bool     `name:"update" short:"u" type:"bool" help:"Update (go mod tidy) before building."`
	IgnoreCache bool     `name:"no-cache" type:"bool" help:"Ignore the cache and rebuild, even if no Go files have changed."`
	File        string   `arg:"source" optional:"" help:"Go source file (ex: main.go)"`
}

func (*Build) Run

func (b *Build) Run(c *Context) error

type Context

type Context struct {
	Debug bool
	// contains filtered or unexported fields
}

func (*Context) Get

func (c *Context) Get(name string) (interface{}, error)

func (*Context) Set

func (c *Context) Set(name string, value interface{})

type Do added in v1.0.2

type Do struct {
	Script string   `arg:"script" help:"Name of the script to execute"`
	Args   []string `arg:"arguments" optional:"" help:"Additional arguments to pass to the script"`
}

func (*Do) Run added in v1.0.2

func (d *Do) Run(c *Context) error

type Formatter

type Formatter interface {
	Format(results *tap.Results)
	Summary()
}

type Init

type Init struct {
	Overwrite bool `name:"overwrite" short:"o" help:"If a project already exist, overwrite with no backup and no prompt."`
}

func (*Init) Run

func (i *Init) Run(c *Context) error

type Run

type Run struct {
	Bundle      []string `name:"bundle" short:"b" type:"string" help:"Bundle the application into a tarball/zipball" enum:"zip,tar"`
	OS          []string `name:"os" type:"string" help:"The operating system(s) to build for (any option(s) from 'go tool dist list' is valid)"`
	WASM        bool     `name:"wasm" type:"bool" help:"Output a web assembly (OS is ignored when this option is true)"`
	Output      string   `name:"output" short:"o" type:"string" help:"Output file name"`
	Tips        bool     `name:"tips" short:"t" type:"bool" help:"Display tips in the generated commands"`
	Minify      bool     `name:"minify" short:"m" type:"bool" help:"Set ldflags to strip debugging symbols and remove DWARF generations"`
	Shrink      bool     `name:"shrink" short:"s" type:"bool" help:"Set gccgoflags to strip debugging symbols and remove DWARF generations"`
	DryRun      bool     `name:"dry-run" short:"d" type:"bool" help:"Display the command without executing it."`
	NoWork      bool     `name:"nowork" type:"bool" help:"Set GOWORK=off when building"`
	Update      bool     `name:"update" short:"u" type:"bool" help:"Update (go mod tidy) before building."`
	Port        int      `name:"port" short:"p" help:"The port to run the HTTP server on (WASM only)."`
	IgnoreCache bool     `name:"no-cache" type:"bool" help:"Ignore the cache and rebuild, even if no Go files have changed."`
	File        string   `arg:"source" optional:"" help:"Go source file (ex: main.go)"`
	Args        []string `arg:"" optional:"" help:"Arguments to pass to the executable."`
}

func (*Run) Run

func (b *Run) Run(c *Context) error

type TapOutput

type TapOutput struct {
	Passed     bool
	TestNumber int
	Test       string
	Label      string
	Diagnostic []string
}

func (*TapOutput) Format

func (o *TapOutput) Format() string

type Test

type Test struct {
	Format string `` /* 193-byte string literal not displayed */
}

func (*Test) Run

func (t *Test) Run(c *Context) error

type TestResult

type TestResult struct {
	Action    string `json:"Action"`
	Package   string `json:"Package"`
	Test      string `json:"Test"`
	Passed    bool   `json:"Passed"`
	Output    string `json:"Output"`
	Error     string `json:"Error"`
	Time      string `json:"Time"`
	StartTime string `json:"StartTime"`
	EndTime   string `json:"EndTime"`
}

type Uninstall

type Uninstall struct {
	NoWarn  bool   `name:"no-warn" type:"bool" help:"Will not warn/prompt for approval before removing the app."`
	AppName string `arg:"name" optional:"" help:"Name of the app to uninstall."`
}

func (*Uninstall) Run

func (u *Uninstall) Run(c *Context) error

Jump to

Keyboard shortcuts

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