Skip to content

Commit

Permalink
Make the successfully configured message friendlier
Browse files Browse the repository at this point in the history
The configure output looked like it could be an error message.
This adds a bit of context to say that the configuration was saved, and
clarifies the output to make it easier to understand that it's showing you
what the configuration settings that were saved are.
  • Loading branch information
Katrina Owen committed Jul 13, 2018
1 parent 7e40350 commit 413f3de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func runConfigure(configuration config.Configuration, flags *pflag.FlagSet) erro
if err := configuration.Save("user"); err != nil {
return err
}
fmt.Fprintln(Err, "\nYou have configured the Exercism command-line client:")
printCurrentConfig(configuration)
return nil
}
Expand All @@ -208,10 +209,10 @@ func printCurrentConfig(configuration config.Configuration) {
v := configuration.UserViperConfig

fmt.Fprintln(w, "")
fmt.Fprintln(w, fmt.Sprintf("Config dir:\t%s", configuration.Dir))
fmt.Fprintln(w, fmt.Sprintf("-t, --token\t%s", v.GetString("token")))
fmt.Fprintln(w, fmt.Sprintf("-w, --workspace\t%s", v.GetString("workspace")))
fmt.Fprintln(w, fmt.Sprintf("-a, --api\t%s", v.GetString("apibaseurl")))
fmt.Fprintln(w, fmt.Sprintf("Config dir:\t\t%s", configuration.Dir))
fmt.Fprintln(w, fmt.Sprintf("Token:\t(-t, --token)\t%s", v.GetString("token")))
fmt.Fprintln(w, fmt.Sprintf("Workspace:\t(-w, --workspace)\t%s", v.GetString("workspace")))
fmt.Fprintln(w, fmt.Sprintf("API Base URL:\t(-a, --api)\t%s", v.GetString("apibaseurl")))
fmt.Fprintln(w, "")
}

Expand Down

0 comments on commit 413f3de

Please sign in to comment.