summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorRyan Gonzalez <rymg19@gmail.com>2015-08-15 17:13:18 -0500
committerRyan Gonzalez <rymg19@gmail.com>2015-08-15 17:14:19 -0500
commitd66cc007502d62133603189f73fb53bc0a81ef5c (patch)
tree069e68f1890c4f7ca24c85221faa20f1d1f9dff1 /compiler
parentc3ee2d683b9e2731fdfa43db5fc03fd76eef4a87 (diff)
downloadNim-d66cc007502d62133603189f73fb53bc0a81ef5c.tar.gz
Give a nice error when no command is given
Diffstat (limited to 'compiler')
-rw-r--r--compiler/msgs.nim3
-rw-r--r--compiler/nim.nim2
2 files changed, 4 insertions, 1 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index bb247ea54..9bff6c123 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -82,7 +82,7 @@ type
     errArrayExpectsTwoTypeParams, errInvalidVisibilityX, errInitHereNotAllowed,
     errXCannotBeAssignedTo, errIteratorNotAllowed, errXNeedsReturnType,
     errNoReturnTypeDeclared,
-    errInvalidCommandX, errXOnlyAtModuleScope,
+    errNoCommand, errInvalidCommandX, errXOnlyAtModuleScope,
     errXNeedsParamObjectType,
     errTemplateInstantiationTooNested, errInstantiationFrom,
     errInvalidIndexValueForTuple, errCommandExpectsFilename,
@@ -316,6 +316,7 @@ const
     errIteratorNotAllowed: "iterators can only be defined at the module\'s top level",
     errXNeedsReturnType: "$1 needs a return type",
     errNoReturnTypeDeclared: "no return type declared",
+    errNoCommand: "no command given",
     errInvalidCommandX: "invalid command: \'$1\'",
     errXOnlyAtModuleScope: "\'$1\' is only allowed at top level",
     errXNeedsParamObjectType: "'$1' needs a parameter that has an object type",
diff --git a/compiler/nim.nim b/compiler/nim.nim
index 5da87dfa3..ce9028d53 100644
--- a/compiler/nim.nim
+++ b/compiler/nim.nim
@@ -58,6 +58,8 @@ proc handleCmdLine() =
     # command line can overwite the config file's settings
     extccomp.initVars()
     processCmdLine(passCmd2, "")
+    if options.command == "":
+      rawMessage(errNoCommand, command)
     mainCommand()
     if optHints in gOptions and hintGCStats in gNotes: echo(GC_getStatistics())
     #echo(GC_getStatistics())