diff src/main/kotlin/name/blackcap/passman/ListSubcommand.kt @ 8:698c4a3d758d

Some code clean-up.
author David Barts <n5jrn@me.com>
date Fri, 23 Sep 2022 20:59:52 -0700
parents f245b9a53495
children 72619175004e
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/ListSubcommand.kt	Tue Sep 20 21:54:32 2022 -0700
+++ b/src/main/kotlin/name/blackcap/passman/ListSubcommand.kt	Fri Sep 23 20:59:52 2022 -0700
@@ -63,6 +63,9 @@
             HelpFormatter().printHelp("$SHORTNAME list", options)
             exitProcess(0)
         }
+        if (commandLine.args.isNotEmpty()) {
+            error("unexpected trailing arguments")
+        }
 
         STRING_OPTIONS.forEach {
             commandLine.getOptionValues(it.name)?.forEach { value ->
@@ -122,8 +125,8 @@
             var count = 0;
             while (results.next()) {
                 val entry = Entry(
-                    name = results.getDecryptedString(1, db.encryption),
-                    username = results.getDecryptedString(2, db.encryption),
+                    name = results.getDecryptedString(1, db.encryption)!!,
+                    username = results.getDecryptedString(2, db.encryption)!!,
                     password = REDACTED,
                     notes = results.getDecryptedString(3, db.encryption),
                     created = results.getDate(4),