Support for global flags in help text
This commit is contained in:
27
flag.go
Normal file
27
flag.go
Normal 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)
|
||||
}
|
Reference in New Issue
Block a user