-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathflags.go
More file actions
58 lines (41 loc) · 1.81 KB
/
flags.go
File metadata and controls
58 lines (41 loc) · 1.81 KB
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
package common
import (
flag "github.com/spf13/pflag"
)
var (
// WipeFlags is the flag for wiping the machine storage on deployment/restart.
WipeFlags *flag.FlagSet
// DeploymentFlags provide the deployment name.
DeploymentFlags *flag.FlagSet
// NoUpdateFlag is the flag for disabling the rofl.yaml manifest file update.
NoUpdateFlag *flag.FlagSet
// TermFlags provide the term and count setting.
TermFlags *flag.FlagSet
// ShowOffersFlag is the flag for showing all provider offers.
ShowOffersFlag *flag.FlagSet
// DeploymentName is the name of the ROFL app deployment.
DeploymentName string
// WipeStorage enables wiping the machine storage on deployment/restart.
WipeStorage bool
// NoUpdate disables updating the rofl.yaml manifest file.
NoUpdate bool
// Term specifies the rental base unit.
Term string
// TermCount specific the rental base unit multiplier.
TermCount uint64
// ShowOffers controls whether to display all offers for each provider.
ShowOffers bool
)
func init() {
WipeFlags = flag.NewFlagSet("", flag.ContinueOnError)
WipeFlags.BoolVar(&WipeStorage, "wipe-storage", false, "whether to wipe machine storage")
DeploymentFlags = flag.NewFlagSet("", flag.ContinueOnError)
DeploymentFlags.StringVar(&DeploymentName, "deployment", "", "deployment name")
NoUpdateFlag = flag.NewFlagSet("", flag.ContinueOnError)
NoUpdateFlag.BoolVar(&NoUpdate, "no-update-manifest", false, "do not update the manifest")
TermFlags = flag.NewFlagSet("", flag.ContinueOnError)
TermFlags.StringVar(&Term, "term", "", "term to pay for in advance [hour, month, year]")
TermFlags.Uint64Var(&TermCount, "term-count", 1, "number of terms to pay for in advance")
ShowOffersFlag = flag.NewFlagSet("", flag.ContinueOnError)
ShowOffersFlag.BoolVar(&ShowOffers, "show-offers", false, "show all offers for each provider")
}