/
clicontext.go
60 lines (54 loc) · 1.38 KB
/
clicontext.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"github.com/urfave/cli"
"time"
)
type innerContext interface {
Args() cli.Args
Bool(name string) bool
BoolT(name string) bool
Duration(name string) time.Duration
FlagNames() (names []string)
Float64(name string) float64
Generic(name string) interface{}
GlobalBool(name string) bool
GlobalBoolT(name string) bool
GlobalDuration(name string) time.Duration
GlobalFlagNames() (names []string)
GlobalFloat64(name string) float64
GlobalGeneric(name string) interface{}
GlobalInt(name string) int
GlobalInt64(name string) int64
GlobalInt64Slice(name string) []int64
GlobalIntSlice(name string) []int
GlobalIsSet(name string) bool
GlobalSet(name, value string) error
GlobalString(name string) string
GlobalStringSlice(name string) []string
GlobalUint(name string) uint
GlobalUint64(name string) uint64
Int(name string) int
Int64(name string) int64
Int64Slice(name string) []int64
IntSlice(name string) []int
IsSet(name string) bool
NArg() int
NumFlags() int
Parent() *cli.Context
Set(name, value string) error
String(name string) string
StringSlice(name string) []string
Uint(name string) uint
Uint64(name string) uint64
App() *cli.App
Command() cli.Command
}
type cliContextWrapper struct {
*cli.Context
}
func (c cliContextWrapper) App() *cli.App {
return c.Context.App
}
func (c cliContextWrapper) Command() cli.Command {
return c.Context.Command
}