mirror of
https://github.com/irmen/prog8.git
synced 2025-02-27 03:29:22 +00:00
give error when passing invalid command line option
This commit is contained in:
parent
2732d2c844
commit
29e2d4e0c8
@ -40,8 +40,8 @@ private fun compileMain(args: Array<String>) {
|
|||||||
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watches for file changes), greatly increases compilation speed")
|
val watchMode by cli.option(ArgType.Boolean, fullName = "watch", description = "continuous compilation mode (watches for file changes), greatly increases compilation speed")
|
||||||
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
val slowCodegenWarnings by cli.option(ArgType.Boolean, fullName = "slowwarn", description="show debug warnings about slow/problematic assembly code generation")
|
||||||
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler, currently '${C64Target.name}' and '${Cx16Target.name}' available").default(C64Target.name)
|
val compilationTarget by cli.option(ArgType.String, fullName = "target", description = "target output of the compiler, currently '${C64Target.name}' and '${Cx16Target.name}' available").default(C64Target.name)
|
||||||
val moduleFiles by cli.argument(ArgType.String, fullName = "modules", description = "main module file(s) to compile").multiple(999)
|
|
||||||
val libDirs by cli.option(ArgType.String, fullName="libdirs", description = "list of extra paths to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
val libDirs by cli.option(ArgType.String, fullName="libdirs", description = "list of extra paths to search in for imported modules").multiple().delimiter(File.pathSeparator)
|
||||||
|
val moduleFiles by cli.argument(ArgType.String, fullName = "modules", description = "main module file(s) to compile").multiple(999)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cli.parse(args)
|
cli.parse(args)
|
||||||
@ -56,6 +56,12 @@ private fun compileMain(args: Array<String>) {
|
|||||||
exitProcess(1)
|
exitProcess(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val faultyOption = moduleFiles.firstOrNull { it.startsWith('-') }
|
||||||
|
if(faultyOption!=null) {
|
||||||
|
System.err.println("Unknown command line option given: $faultyOption")
|
||||||
|
exitProcess(1)
|
||||||
|
}
|
||||||
|
|
||||||
val libdirs = libDirs.toMutableList()
|
val libdirs = libDirs.toMutableList()
|
||||||
if(libdirs.firstOrNull()!=".")
|
if(libdirs.firstOrNull()!=".")
|
||||||
libdirs.add(0, ".")
|
libdirs.add(0, ".")
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
TODO
|
TODO
|
||||||
====
|
====
|
||||||
|
|
||||||
- should give error when passing invalid command line arguments
|
|
||||||
|
|
||||||
- test all examples (including imgviewer, assembler and petaxian) before release of the new version
|
- test all examples (including imgviewer, assembler and petaxian) before release of the new version
|
||||||
|
|
||||||
- simplify cx16.joystick_get2() once this cx16 rom issue is resolved: https://github.com/commanderx16/x16-rom/issues/203
|
- simplify cx16.joystick_get2() once this cx16 rom issue is resolved: https://github.com/commanderx16/x16-rom/issues/203
|
||||||
|
Loading…
x
Reference in New Issue
Block a user