args

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: 2 Imported by: 0

README

args example

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

package main

import (
	"fmt"

	"github.com/jpillora/opts"
)

type Config struct {
	Bazzes []string `min:"2"`
}

func main() {

	c := Config{}

	opts.New(&c).Parse()

	for i, foo := range c.Bazzes {
		fmt.Println(i, foo)
	}
}
``` $ args --foo hello --bar world ``` ``` plain 0 foo 1 bar ``` ``` $ args --help ``` ``` plain

Usage: args [options] bazzes...

Options: --help, -h

</tmpl>

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