command.v1: maze.io/x/command.v1 Index | Files

package command

import "maze.io/x/command.v1"

Package command is for building subcommands using the default flag package.

Index

Package Files

command.go

Variables

var (
    // Output is the default output for Usage() etc.
    Output io.Writer = os.Stderr
)

func Add Uses

func Add(name, description string, cmd Command, required []string)

Add a subcommand.

func Parse Uses

func Parse()

Parse command line flags.

func ParseAndRun Uses

func ParseAndRun()

ParseAndRun calls Parse then Run.

func Run Uses

func Run()

Run (sub)command.

func Usage Uses

func Usage()

Usage prints command usage to stdout.

type Command Uses

type Command interface {
    Flags(*flag.FlagSet) *flag.FlagSet
    Run(...string)
}

Command is a sub command.

Package command imports 5 packages (graph). Updated 2019-02-22. Refresh now. Tools for package owners.