@@ -5,15 +5,22 @@ import (
5
5
"github.com/spf13/cobra"
6
6
)
7
7
8
+ const (
9
+ authShort = "Authenticate with YouTube API"
10
+ authLong = "Authenticate with YouTube API to access and manage YouTube resources."
11
+ credUsage = "Path to client secret file, or base64 encoded string, or json string"
12
+ cacheUsage = "Path to token cache file, or base64 encoded string, or json string"
13
+ )
14
+
8
15
var (
9
16
credential string
10
17
cacheToken string
11
18
)
12
19
13
20
var authCmd = & cobra.Command {
14
21
Use : "auth" ,
15
- Short : "Authenticate with YouTube API" ,
16
- Long : "Authenticate with YouTube API" ,
22
+ Short : authShort ,
23
+ Long : authLong ,
17
24
Run : func (cmd * cobra.Command , args []string ) {
18
25
auth .NewY2BService (
19
26
auth .WithCredential (credential ),
@@ -27,11 +34,9 @@ func init() {
27
34
RootCmd .AddCommand (authCmd )
28
35
29
36
authCmd .Flags ().StringVarP (
30
- & credential , "credential" , "c" , "client_secret.json" ,
31
- "Path to client secret file, or base64 encoded string, or json string" ,
37
+ & credential , "credential" , "c" , "client_secret.json" , credUsage ,
32
38
)
33
39
authCmd .Flags ().StringVarP (
34
- & cacheToken , "cacheToken" , "t" , "youtube.token.json" ,
35
- "Path to token cache file, or base64 encoded string, or json string" ,
40
+ & cacheToken , "cacheToken" , "t" , "youtube.token.json" , cacheUsage ,
36
41
)
37
42
}
0 commit comments