Skip to content

Commit 1a20421

Browse files
committed
Merge pull request #297 from mrageh/enhance-debug-output-when-api-key-is-not-set
Enhance debug output when api key is absent
2 parents f391cc1 + 8f131b3 commit 1a20421

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cmd/debug.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ func Debug(ctx *cli.Context) {
6464

6565
if configured {
6666
fmt.Printf("Config file: %s\n", c.File)
67-
fmt.Printf("API Key: %s\n", c.APIKey)
67+
if c.APIKey != "" {
68+
fmt.Printf("API Key: %s\n", c.APIKey)
69+
} else {
70+
fmt.Println("API Key: Please set your API Key to access all of the CLI features")
71+
}
6872
} else {
6973
fmt.Println("Config file: <not configured>")
70-
fmt.Println("API Key: <not configured>")
74+
fmt.Println("API Key: Please set your API Key to access all of the CLI features")
7175
}
7276
fmt.Printf("Exercises Directory: %s\n", c.Dir)
7377

0 commit comments

Comments
 (0)