-
Notifications
You must be signed in to change notification settings - Fork 557
/
flags.go
31 lines (26 loc) · 875 Bytes
/
flags.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
package cli
import (
"time"
flag "github.com/spf13/pflag"
)
// Flags for incentives module tx commands.
const (
FlagDuration = "duration"
FlagStartTime = "start-time"
FlagEpochs = "epochs"
FlagPerpetual = "perpetual"
FlagTimestamp = "timestamp"
FlagOwner = "owner"
FlagLockIds = "lock-ids"
FlagEndEpoch = "end-epoch"
)
// FlagSetCreateGauge returns flags for creating gauges.
func FlagSetCreateGauge() *flag.FlagSet {
fs := flag.NewFlagSet("", flag.ContinueOnError)
dur, _ := time.ParseDuration("24h")
fs.Duration(FlagDuration, dur, "The duration token to be locked, default 1d(24h). Other examples are 7d(168h), 14d(336h). Maximum unit is hour.")
fs.String(FlagStartTime, "", "Timestamp to begin distribution")
fs.Uint64(FlagEpochs, 0, "Total epochs to distribute tokens")
fs.Bool(FlagPerpetual, false, "Perpetual distribution")
return fs
}