command.v1: Index | Files

package command

import ""

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


Package Files



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

Command is a sub command.

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