Give a nice error when no command is given
This commit is contained in:
parent
c3ee2d683b
commit
d66cc00750
2 changed files with 4 additions and 1 deletions
|
|
@ -82,7 +82,7 @@ type
|
||||||
errArrayExpectsTwoTypeParams, errInvalidVisibilityX, errInitHereNotAllowed,
|
errArrayExpectsTwoTypeParams, errInvalidVisibilityX, errInitHereNotAllowed,
|
||||||
errXCannotBeAssignedTo, errIteratorNotAllowed, errXNeedsReturnType,
|
errXCannotBeAssignedTo, errIteratorNotAllowed, errXNeedsReturnType,
|
||||||
errNoReturnTypeDeclared,
|
errNoReturnTypeDeclared,
|
||||||
errInvalidCommandX, errXOnlyAtModuleScope,
|
errNoCommand, errInvalidCommandX, errXOnlyAtModuleScope,
|
||||||
errXNeedsParamObjectType,
|
errXNeedsParamObjectType,
|
||||||
errTemplateInstantiationTooNested, errInstantiationFrom,
|
errTemplateInstantiationTooNested, errInstantiationFrom,
|
||||||
errInvalidIndexValueForTuple, errCommandExpectsFilename,
|
errInvalidIndexValueForTuple, errCommandExpectsFilename,
|
||||||
|
|
@ -316,6 +316,7 @@ const
|
||||||
errIteratorNotAllowed: "iterators can only be defined at the module\'s top level",
|
errIteratorNotAllowed: "iterators can only be defined at the module\'s top level",
|
||||||
errXNeedsReturnType: "$1 needs a return type",
|
errXNeedsReturnType: "$1 needs a return type",
|
||||||
errNoReturnTypeDeclared: "no return type declared",
|
errNoReturnTypeDeclared: "no return type declared",
|
||||||
|
errNoCommand: "no command given",
|
||||||
errInvalidCommandX: "invalid command: \'$1\'",
|
errInvalidCommandX: "invalid command: \'$1\'",
|
||||||
errXOnlyAtModuleScope: "\'$1\' is only allowed at top level",
|
errXOnlyAtModuleScope: "\'$1\' is only allowed at top level",
|
||||||
errXNeedsParamObjectType: "'$1' needs a parameter that has an object type",
|
errXNeedsParamObjectType: "'$1' needs a parameter that has an object type",
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ proc handleCmdLine() =
|
||||||
# command line can overwite the config file's settings
|
# command line can overwite the config file's settings
|
||||||
extccomp.initVars()
|
extccomp.initVars()
|
||||||
processCmdLine(passCmd2, "")
|
processCmdLine(passCmd2, "")
|
||||||
|
if options.command == "":
|
||||||
|
rawMessage(errNoCommand, command)
|
||||||
mainCommand()
|
mainCommand()
|
||||||
if optHints in gOptions and hintGCStats in gNotes: echo(GC_getStatistics())
|
if optHints in gOptions and hintGCStats in gNotes: echo(GC_getStatistics())
|
||||||
#echo(GC_getStatistics())
|
#echo(GC_getStatistics())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue