diff --git a/.gitignore b/.gitignore index 69b7b949..e26379ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ bin src/github.com src/golang.org -go-arduino-compiler +arduino-builder # Created by .ignore support plugin (hsz.mobi) ### Go template diff --git a/main.go b/main.go index 11659bcf..2daa92a1 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,7 @@ func main() { dumpPrefs := *dumpPrefsFlag if compile && dumpPrefs { - fmt.Println("You can either specify --compile or --dump-prefs, not both") + fmt.Fprintln(os.Stderr, "You can either specify --compile or --dump-prefs, not both") defer os.Exit(1) return } @@ -138,7 +138,7 @@ func main() { } if len(hardware) == 0 { - fmt.Println("Parameter 'hardware' is mandatory") + fmt.Fprintln(os.Stderr, "Parameter 'hardware' is mandatory") flag.Usage() defer os.Exit(1) return @@ -153,7 +153,7 @@ func main() { } if len(tools) == 0 { - fmt.Println("Parameter 'tools' is mandatory") + fmt.Fprintln(os.Stderr, "Parameter 'tools' is mandatory") flag.Usage() defer os.Exit(1) return @@ -184,7 +184,7 @@ func main() { } if fqbn == "" { - fmt.Println("Parameter 'fqbn' is mandatory") + fmt.Fprintln(os.Stderr, "Parameter 'fqbn' is mandatory") flag.Usage() defer os.Exit(1) return @@ -201,7 +201,7 @@ func main() { if buildPath != "" { _, err := os.Stat(buildPath) if err != nil { - fmt.Println(err) + fmt.Fprintln(os.Stderr, err) defer os.Exit(1) return } @@ -216,7 +216,7 @@ func main() { context[constants.CTX_BUILD_PATH] = buildPath if compile && flag.NArg() == 0 { - fmt.Println("Last parameter must be the sketch to compile") + fmt.Fprintln(os.Stderr, "Last parameter must be the sketch to compile") flag.Usage() defer os.Exit(1) return @@ -264,10 +264,10 @@ func main() { if err != nil { err = utils.WrapError(err) - fmt.Println(err) + fmt.Fprintln(os.Stderr, err) if utils.DebugLevel(context) >= 10 { - fmt.Println(err.(*errors.Error).ErrorStack()) + fmt.Fprintln(os.Stderr, err.(*errors.Error).ErrorStack()) } exitCode = toExitCode(err) @@ -299,5 +299,5 @@ func toSliceOfUnquoted(value slice) ([]string, error) { func printCompleteError(err error) { err = utils.WrapError(err) - fmt.Println(err.(*errors.Error).ErrorStack()) + fmt.Fprintln(os.Stderr, err.(*errors.Error).ErrorStack()) } diff --git a/src/arduino.cc/builder/constants/constants.go b/src/arduino.cc/builder/constants/constants.go index c35eb49e..cb7732fa 100644 --- a/src/arduino.cc/builder/constants/constants.go +++ b/src/arduino.cc/builder/constants/constants.go @@ -81,7 +81,7 @@ const CTX_DEBUG_LEVEL = "debugLevel" const CTX_FIRST_FUNCTION_AT_LINE = "firstFunctionAtLine" const CTX_FQBN = "fqbn" const CTX_GCC_MINUS_E_SOURCE = "gccMinusESource" -const CTX_GCC_MINUS_M_OUTPUT = "gccMinusMOutout" +const CTX_GCC_MINUS_M_OUTPUT = "gccMinusMOutput" const CTX_HARDWARE_FOLDERS = "hardwareFolders" const CTX_HARDWARE = "hardware" const CTX_HEADER_TO_LIBRARIES = "headerToLibraries"