-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.go
29 lines (25 loc) · 947 Bytes
/
config.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
package main
import (
"flag"
"runtime"
)
type Config struct {
ContainerName string `json:"containerName"`
Prefix string `json:"prefix"`
Verbose bool `json:"verbose"`
Provider string `json:"provider"`
Threads int `json:"threads"`
Empty bool `json:"empty_only"`
FilterWorkspace string `json:"filter_by_name"`
}
// init the config with flag args
func (c *Config) Init() {
flag.StringVar(&c.Provider, "provider", "", "s3 so far")
flag.StringVar(&c.ContainerName, "container", "", "The ContainerName")
flag.StringVar(&c.Prefix, "prefix", "", "Prefix")
flag.BoolVar(&c.Verbose, "verbose", false, "Be Verbose")
flag.IntVar(&c.Threads, "threads", runtime.NumCPU(), "Number of threads. Default to cores count")
flag.BoolVar(&c.Empty, "list-empty", false, "List empty states only ")
flag.StringVar(&c.FilterWorkspace, "filter-workspace", "", "Filter workspace by name")
flag.Parse()
}