commander

package
v0.0.0-...-7eea47d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands []Command

Commands is an array of all the created commands

View Source
var ExtraArgs []string

ExtraArgs is an array of unused arguments (no commands match them)

Functions

func ParseArgs

func ParseArgs()

ParseArgs will parse the command line arguments and match them with commands

Types

type Command

type Command struct {
	Name          string
	Description   string
	Argument      string
	ShortArgument string
	NeedsValue    bool
	Required      bool
	Action        func(value string)
}

Command represents a single command

func Create

func Create(name string, description string, needsValue bool, required bool, action func(value string)) Command

Create is used to create new commands

Jump to

Keyboard shortcuts

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