help

command
v0.0.0-...-0cf3de4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2016 License: MIT, MIT Imports: 1 Imported by: 0

README

help example

<tmpl,code=go:cat help.go>

package main

import "github.com/jpillora/opts"

type HelpConfig struct {
	Zip  string `arg:"!" help:"zip is very lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at commodo odio. Sed id tincidunt purus. Cras vel felis dictum, lobortis metus a, tempus tellus"`
	Foo  string `help:"this is help for foo"`
	Bar  string `help:"and help for bar"`
	Fizz string `help:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at commodo odio. Sed id tincidunt purus. Cras vel felis dictum, lobortis metus a, tempus tellus"`
	Buzz string `help:"and help for buzz"`
}

func main() {

	c := HelpConfig{
		Foo: "42",
	}

	opts.New(&c).
		Name("help").
		Version("1.0.0").
		Repo("https://github.com/jpillora/foo").
		Parse()
}
$ help --help

<tmpl,code: go run help.go --help>


  Usage: help [options]

  Options:
  --zip, -z      zip is very lorem ipsum dolor sit amet, consectetur
                 adipiscing elit. Phasellus at commodo odio. Sed id tincidunt
                 purus. Cras vel felis dictum, lobortis metus a, tempus
                 tellus
  --foo, -f      this is help for foo (default 42)
  --bar, -b      and help for bar
  --fizz         Lorem ipsum dolor sit amet, consectetur adipiscing elit.
                 Phasellus at commodo odio. Sed id tincidunt purus. Cras
                 vel felis dictum, lobortis metus a, tempus tellus
  --buzz         and help for buzz
  --help, -h
  --version, -v

  Version:
    1.0.0

  Read more:
    https://github.com/jpillora/foo

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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