aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-11-10 19:41:04 -0300
committerMaurĂ­cio Antunes <mauricio.abreua@gmail.com>2022-11-10 19:41:04 -0300
commit4d0b3f5fd964399eb2b31b5b32028ff567a4631e (patch)
treef5a20286b173e17eba0ba0f115b88acd57109e5b
parentd8779c6ad109d294296bf6101973db546e06bd38 (diff)
feat: improve messages for run and verify commands
-rw-r--r--golings/cmd/run.go4
-rw-r--r--golings/cmd/verify.go5
2 files changed, 6 insertions, 3 deletions
diff --git a/golings/cmd/run.go b/golings/cmd/run.go
index aa869b3..21204c9 100644
--- a/golings/cmd/run.go
+++ b/golings/cmd/run.go
@@ -19,7 +19,9 @@ var cmdRun = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
result, err := exercises.Run(args[0])
if err != nil {
- color.Red("Compilation of %s failed! Compiler error message:\n\n%s", result.Exercise.Path, result.Err)
+ color.Cyan("Failed to compile the exercise %s\n\n", result.Exercise.Path)
+ color.White("Check the error below: \n\n")
+ color.Red(result.Err)
color.Yellow("If you feel stuck, ask a hint by executing `golings hint %s`", result.Exercise.Name)
os.Exit(1)
} else {
diff --git a/golings/cmd/verify.go b/golings/cmd/verify.go
index 6ab0fef..f662350 100644
--- a/golings/cmd/verify.go
+++ b/golings/cmd/verify.go
@@ -45,8 +45,9 @@ var cmdVerify = &cobra.Command{
bar.Add(1)
if v.Err != "" {
fmt.Print("\n\n")
- color.Cyan("Failed to compile the exercise %s\n", v.Exercise.Path)
- color.Red("Check the error: %s", v.Err)
+ color.Cyan("Failed to compile the exercise %s\n\n", v.Exercise.Path)
+ color.White("Check the error below: \n\n")
+ color.Red(v.Err)
os.Exit(1)
}
}