-
Notifications
You must be signed in to change notification settings - Fork 3
/
root.go
51 lines (46 loc) · 964 Bytes
/
root.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
package sonarr
import (
"os"
"github.com/spf13/cobra"
)
var (
RootSonarrCmd = &cobra.Command{
Use: "sonarr",
Short: "To Control Sonarr",
}
keywords string
slackNotification string
slackIncomingHookURL string
)
var (
_ = func() struct{} {
RootSonarrCmd.AddCommand(SearchSonarrCmd)
return struct{}{}
}()
)
var (
_ = func() struct{} {
SearchSonarrCmd.Flags().StringVarP(&slackNotification,
"slack-notification",
"n",
os.Getenv("SLACK_NOTIFICATION"),
"if true, will try to notify to a slack channel",
)
SearchSonarrCmd.Flags().StringVarP(&slackIncomingHookURL,
"slack-notification-channel",
"s",
os.Getenv("SLACK_REQUESTS_HOOK_URL"),
"slack channel to notify",
)
SearchSonarrCmd.Flags().StringVarP(&keywords,
"keyword",
"k",
"",
"the keywords that will be used to search for matching title movies",
)
RootSonarrCmd.AddCommand(
SearchSonarrCmd,
)
return struct{}{}
}()
)