diff src/name/blackcap/imageprep/Main.kt @ 5:884f1415a330

Rationalized directory management.
author David Barts <n5jrn@me.com>
date Fri, 17 Jul 2020 17:11:43 -0700
parents 5234e4500d45
children 5fa5d15b4a7b
line wrap: on
line diff
--- a/src/name/blackcap/imageprep/Main.kt	Fri Jul 17 14:51:41 2020 -0700
+++ b/src/name/blackcap/imageprep/Main.kt	Fri Jul 17 17:11:43 2020 -0700
@@ -34,11 +34,13 @@
 }
 
 fun main(args: Array<String>) {
+    /* start up */
     LOGGER.log(Level.INFO, "beginning execution")
     if (OS.type == OS.MAC) {
         System.setProperty("apple.laf.useScreenMenuBar", "true")
     }
 
+    /* parse command line */
     if (Settings.outputToInputDir)
         Settings.outputTo = System.getProperty("user.dir")
     val options = Options().apply {
@@ -56,7 +58,7 @@
         addOption(Option<File>("o", "output", true, "Output directory (default: ${Settings.outputTo})").apply {
             default = File(Settings.outputTo)
             interpolater = {
-                val ret = File(it)
+                val ret = File(tilde(it))
                 if (!ret.exists())
                     throw InvalidArgumentException("'${it}' does not exist")
                 if (!ret.isDirectory())
@@ -79,7 +81,7 @@
     val cmdLine: CommandLine? = try {
         PromptingParser().parse(options, args)
     } catch (e: ParseException) {
-        System.err.println("${Application.MYNAME}: syntax error - ${e.message}")
+        System.err.println("${Application.MYNAME}: Syntax error - ${e.message}")
         System.exit(2)
         null
     }
@@ -89,6 +91,7 @@
         System.exit(0);
     }
 
+    /* launch GUI */
     inSwingThread {
         Application.initialize()
         for (fileName in cmdLine!!.args)