-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget.go
More file actions
34 lines (28 loc) · 874 Bytes
/
get.go
File metadata and controls
34 lines (28 loc) · 874 Bytes
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
package globalconfig
import (
"fmt"
"github.com/stacktodate/stacktodate-cli/cmd/helpers"
"github.com/spf13/cobra"
)
var getCmd = &cobra.Command{
Use: "status",
Short: "Show current authentication configuration",
Long: `Display information about where your authentication token is stored and its status.`,
Run: func(cmd *cobra.Command, args []string) {
source, isSecure, err := helpers.GetTokenSource()
if err != nil {
fmt.Println("Status: Not configured")
fmt.Println("")
fmt.Println("To set up authentication, run:")
fmt.Println(" stacktodate global-config set")
return
}
fmt.Println("Status: Configured")
fmt.Printf("Source: %s\n", source)
if !isSecure {
fmt.Println("")
fmt.Println("⚠️ Warning: Token stored in plain text file")
fmt.Println("For better security, use a system with OS keychain support")
}
},
}