-
Notifications
You must be signed in to change notification settings - Fork 0
/
cmdline.go
58 lines (52 loc) · 1.23 KB
/
cmdline.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
package main
import "flag"
type Args struct {
AuthOnly bool
AddChannel bool
InspectChannels bool
ResolvePlaylists bool
SampleConfig bool
Verbose bool
Noop bool
}
func parseArgs() Args {
args := Args{
AuthOnly: false,
AddChannel: false,
InspectChannels: false,
ResolvePlaylists: false,
SampleConfig: false,
Verbose: false,
Noop: false,
}
flag.BoolVar(
&args.AuthOnly, "auth-only", args.AuthOnly,
"Just authenticate, nothing more",
)
flag.BoolVar(
&args.AddChannel, "add-channel", args.AddChannel,
"Add channel",
)
flag.BoolVar(
&args.InspectChannels, "inspect-channels", args.InspectChannels,
"Given the channels in the config, list their playlists",
)
flag.BoolVar(
&args.ResolvePlaylists, "resolve-playlists", args.ResolvePlaylists,
"Resolve playlist details and update config",
)
flag.BoolVar(
&args.SampleConfig, "sample-config", args.SampleConfig,
"Generate a sample config, if one doesn't exist",
)
flag.BoolVar(
&args.Verbose, "verbose", args.Verbose,
"Verbose logging",
)
flag.BoolVar(
&args.Noop, "noop", args.Noop,
"Don't actually add videos -- still do all the rest",
)
flag.Parse()
return args
}