func (fs *FlagSet) Visit(fn func(*Flag)) {
	for _, flag := range sortFlags(fs.actual) {
		fn(flag)
	}
}
Visit visits the flags in lexicographical order, calling fn for each.
It visits only those flags that have been set.
package mflag
import (
	"errors"
	"fmt"
	"io"
	"os"
	"runtime"
	"sort"
	"strconv"
	"strings"
	"text/tabwriter"
	"time"
	"github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir"
)
var ErrHelp = errors.New("flag: help requested")
var ErrRetry = errors.New("flag: retry")
type boolValue bool
func newBoolValue(val bool, p *bool) *boolValue {
	*p = val
	return (*boolValue)(p)
}
func (b *boolValue) Set(s string) error {
	v, err := strconv.ParseBool(s)
	*b = boolValue(v)
	return err
}
func (b *boolValue) Get() interface{} { return bool(*b) }
func (b *boolValue) String() string { return fmt.Sprintf("%v", *b) }
func (b *boolValue) IsBoolFlag() bool { return true }
type boolFlag interface {
	Value
	IsBoolFlag() bool
}
type intValue int
func newIntValue(val int, p *int) *intValue {
	*p = val
	return (*intValue)(p)
}
func (i *intValue) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 64)
	*i = intValue(v)
	return err
}
func (i *intValue) Get() interface{} { return int(*i) }
func (i *intValue) String() string { return fmt.Sprintf("%v", *i) }
type int64Value int64
func newInt64Value(val int64, p *int64) *int64Value {
	*p = val
	return (*int64Value)(p)
}
func (i *int64Value) Set(s string) error {
	v, err := strconv.ParseInt(s, 0, 64)
	*i = int64Value(v)
	return err
}
func (i *int64Value) Get() interface{} { return int64(*i) }
func (i *int64Value) String() string { return fmt.Sprintf("%v", *i) }
type uintValue uint
func newUintValue(val uint, p *uint) *uintValue {
	*p = val
	return (*uintValue)(p)
}
func (i *uintValue) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	*i = uintValue(v)
	return err
}
func (i *uintValue) Get() interface{} { return uint(*i) }
func (i *uintValue) String() string { return fmt.Sprintf("%v", *i) }
type uint64Value uint64
func newUint64Value(val uint64, p *uint64) *uint64Value {
	*p = val
	return (*uint64Value)(p)
}
func (i *uint64Value) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	*i = uint64Value(v)
	return err
}
func (i *uint64Value) Get() interface{} { return uint64(*i) }
func (i *uint64Value) String() string { return fmt.Sprintf("%v", *i) }
type stringValue string
func newStringValue(val string, p *string) *stringValue {
	*p = val
	return (*stringValue)(p)
}
func (s *stringValue) Set(val string) error {
	*s = stringValue(val)
	return nil
}
func (s *stringValue) Get() interface{} { return string(*s) }
func (s *stringValue) String() string { return fmt.Sprintf("%s", *s) }
type float64Value float64
func newFloat64Value(val float64, p *float64) *float64Value {
	*p = val
	return (*float64Value)(p)
}
func (f *float64Value) Set(s string) error {
	v, err := strconv.ParseFloat(s, 64)
	*f = float64Value(v)
	return err
}
func (f *float64Value) Get() interface{} { return float64(*f) }
func (f *float64Value) String() string { return fmt.Sprintf("%v", *f) }
type durationValue time.Duration
func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
	*p = val
	return (*durationValue)(p)
}
func (d *durationValue) Set(s string) error {
	v, err := time.ParseDuration(s)
	*d = durationValue(v)
	return err
}
func (d *durationValue) Get() interface{} { return time.Duration(*d) }
func (d *durationValue) String() string { return (*time.Duration)(d).String() }
type Value interface {
	String() string
	Set(string) error
}
type Getter interface {
	Value
	Get() interface{}
}
type ErrorHandling int
const (
	ContinueOnError ErrorHandling = iota
	ExitOnError
	PanicOnError
)
type FlagSet struct {
	Usage      func()
	ShortUsage func()
	name             string
	parsed           bool
	actual           map[string]*Flag
	formal           map[string]*Flag
	args             []string  
	errorHandling    ErrorHandling
	output           io.Writer  
	nArgRequirements []nArgRequirement
}
type Flag struct {
	Names    []string  
	Usage    string    
	Value    Value     
	DefValue string    
}
type flagSlice []string
func (p flagSlice) Len() int { return len(p) }
func (p flagSlice) Less(i, j int) bool {
	pi, pj := strings.TrimPrefix(p[i], "-"), strings.TrimPrefix(p[j], "-")
	lpi, lpj := strings.ToLower(pi), strings.ToLower(pj)
	if lpi != lpj {
		return lpi < lpj
	}
	return pi < pj
}
func (p flagSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func sortFlags(flags map[string]*Flag) []*Flag {
	var list flagSlice
	nameMap := make(map[string]string)
	for n, f := range flags {
		fName := strings.TrimPrefix(f.Names[0], "#")
		nameMap[fName] = n
		if len(f.Names) == 1 {
			list = append(list, fName)
			continue
		}
		found := false
		for _, name := range list {
			if name == fName {
				found = true
				break
			}
		}
		if !found {
			list = append(list, fName)
		}
	}
	sort.Sort(list)
	result := make([]*Flag, len(list))
	for i, name := range list {
		result[i] = flags[nameMap[name]]
	}
	return result
}
func (fs *FlagSet) Name() string {
	return fs.name
}
func (fs *FlagSet) Out() io.Writer {
	if fs.output == nil {
		return os.Stderr
	}
	return fs.output
}
func (fs *FlagSet) SetOutput(output io.Writer) {
	fs.output = output
}
func (fs *FlagSet) VisitAll(fn func(*Flag)) {
	for _, flag := range sortFlags(fs.formal) {
		fn(flag)
	}
}
func VisitAll(fn func(*Flag)) {
	CommandLine.VisitAll(fn)
}