diff src/main/kotlin/name/blackcap/passman/CreateSubcommand.kt @ 6:711cc42e96d7

Got the list subcommand working, but needs efficiency improvements.
author David Barts <n5jrn@me.com>
date Tue, 20 Sep 2022 20:52:21 -0700
parents eafa3779aef8
children 698c4a3d758d
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/CreateSubcommand.kt	Sun Sep 11 21:29:20 2022 -0700
+++ b/src/main/kotlin/name/blackcap/passman/CreateSubcommand.kt	Tue Sep 20 20:52:21 2022 -0700
@@ -1,9 +1,6 @@
 package name.blackcap.passman
 
-import org.apache.commons.cli.CommandLine
-import org.apache.commons.cli.DefaultParser
-import org.apache.commons.cli.Options
-import org.apache.commons.cli.ParseException
+import org.apache.commons.cli.*
 import kotlin.system.exitProcess
 
 class CreateSubcommand(): Subcommand() {
@@ -21,6 +18,10 @@
         } catch (e: ParseException) {
             die(e.message ?: "syntax error", 2)
         }
+        if (commandLine.hasOption("help")) {
+            HelpFormatter().printHelp("$SHORTNAME createJv", options)
+            exitProcess(0)
+        }
         checkArguments()
         val db = Database.open()