command

package
v0.0.0-...-409007c Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs(flags []*CommandLineFlag, args *CommandLineArgs) func()

Marshal command line into CommandLine* types

func Run

func Run(flags []*CommandLineFlag, args *CommandLineArgs, main_fn func())

A thin wrapper intended for main() funcs. Calls ParseArgs() and sets panic() handler

Types

type CommandLineArgs

type CommandLineArgs struct {
	Names  []string
	Usage  string
	Values []string
}

type CommandLineFlag

type CommandLineFlag struct {
	Long         string
	Short        string
	Usage        string
	UsageParam   string
	Mandatory    bool
	DefaultValue interface{}
	ValueP       interface{}
}

Types for defining command line flags and arguments

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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