Support for global flags in help text

This commit is contained in:
Jeremy Saenz
2013-07-14 19:16:30 -07:00
parent 16bf6d4f76
commit 921da63e2e
3 changed files with 40 additions and 3 deletions

27
flag.go Normal file
View File

@@ -0,0 +1,27 @@
package cli
import "fmt"
type Flag interface {
fmt.Stringer
}
type BoolFlag struct {
Name string
Value bool
Usage string
}
type StringFlag struct {
Name string
Value string
Usage string
}
func (f StringFlag) String() string {
return fmt.Sprintf("--%v 'string'\t%v", f.Name, f.Usage)
}
func (f BoolFlag) String() string {
return fmt.Sprintf("--%v\t%v", f.Name, f.Usage)
}