-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.go
28 lines (22 loc) · 942 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
package main
import "log"
var (
issuer string
clientName string
clientContacts string
scopes string
forceRecreate bool
)
func init() {
// Disable Cobra's completions.
rootCmd.CompletionOptions.DisableDefaultCmd = true
// Configure the main logger
log.SetFlags(log.Lshortfile)
// Define global flags
rootCmd.PersistentFlags().StringVar(&issuer, "iss", "https://wlcg.cloud.cnaf.infn.it/", "The issuer URL.")
rootCmd.PersistentFlags().StringVar(&clientName, "cli-name", "uTok-cli", "OIDC client name.")
rootCmd.PersistentFlags().StringVar(&clientContacts, "cli-contacts", "foo@faa.com", "Comma-separated OIDC client contacts.")
rootCmd.PersistentFlags().StringVar(&scopes, "scopes",
"storage.read:/atlasdatadisk/SAM/,openid,offline_access", "Comma separated scopes to request.")
tokenCmd.PersistentFlags().BoolVar(&forceRecreate, "recreate", false, "Force token recreation even if one is present.")
}