app

package module
v0.0.0-...-87a7834 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 7 Imported by: 0

README

golang-cli-template

golang template repository

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Functions

func Run

func Run(ctx context.Context, args []string) error

Types

type App

type App struct{}

func New

func New(ctx context.Context) (*App, error)

func (*App) Dispatch

func (app *App) Dispatch(ctx context.Context, command string, opts *CLIOptions) error

func (*App) Hello

func (app *App) Hello(ctx context.Context, opt *HelloOption) error

type CLIOptions

type CLIOptions struct {
	Hello    *HelloOption     `cmd:"" help:"say hello"`
	LogLevel string           `help:"logging level: DEBUG, INFO, WARN, ERROR" enum:"DEBUG,INFO,WARN,ERROR" name:"loglevel" default:"INFO"`
	Version  kong.VersionFlag `help:"show Version" short:"v"`
}

type HelloOption

type HelloOption struct {
	Name string `help:"Name" name:"name" short:"n" default:"fuga"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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