commit
b4314428e9
11
app.go
11
app.go
@ -7,7 +7,6 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"reflect"
|
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@ -485,16 +484,6 @@ func (a *App) VisibleFlags() []Flag {
|
|||||||
return visibleFlags(a.Flags)
|
return visibleFlags(a.Flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) hasFlag(flag Flag) bool {
|
|
||||||
for _, f := range a.Flags {
|
|
||||||
if reflect.DeepEqual(flag, f) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *App) errWriter() io.Writer {
|
func (a *App) errWriter() io.Writer {
|
||||||
// When the app ErrWriter is nil use the package level one.
|
// When the app ErrWriter is nil use the package level one.
|
||||||
if a.ErrWriter == nil {
|
if a.ErrWriter == nil {
|
||||||
|
@ -17,7 +17,6 @@ type Context struct {
|
|||||||
App *App
|
App *App
|
||||||
Command *Command
|
Command *Command
|
||||||
shellComplete bool
|
shellComplete bool
|
||||||
setFlags map[string]bool
|
|
||||||
flagSet *flag.FlagSet
|
flagSet *flag.FlagSet
|
||||||
parentContext *Context
|
parentContext *Context
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,3 @@ func expect(t *testing.T, a interface{}, b interface{}) {
|
|||||||
t.Errorf("(%s:%d) Expected %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
t.Errorf("(%s:%d) Expected %v (type %v) - Got %v (type %v)", fn, line, b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func refute(t *testing.T, a interface{}, b interface{}) {
|
|
||||||
if reflect.DeepEqual(a, b) {
|
|
||||||
t.Errorf("Did not expect %v (type %v) - Got %v (type %v)", b, reflect.TypeOf(b), a, reflect.TypeOf(a))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user