comparison src/main/kotlin/name/blackcap/passman/ListSubcommand.kt @ 9:72619175004e

Fix issues found in testing.
author David Barts <n5jrn@me.com>
date Sat, 01 Oct 2022 09:57:23 -0700
parents 698c4a3d758d
children ea65ab890f66
comparison
equal deleted inserted replaced
8:698c4a3d758d 9:72619175004e
58 commandLine = DefaultParser().parse(options, args) 58 commandLine = DefaultParser().parse(options, args)
59 } catch (e: ParseException) { 59 } catch (e: ParseException) {
60 die(e.message ?: "syntax error", 2) 60 die(e.message ?: "syntax error", 2)
61 } 61 }
62 if (commandLine.hasOption(HELP)) { 62 if (commandLine.hasOption(HELP)) {
63 HelpFormatter().printHelp("$SHORTNAME list", options) 63 HelpFormatter().printHelp("$SHORTNAME list [options]", options)
64 exitProcess(0) 64 exitProcess(0)
65 } 65 }
66 if (commandLine.args.isNotEmpty()) { 66 if (commandLine.args.isNotEmpty()) {
67 error("unexpected trailing arguments") 67 die("unexpected trailing arguments", 2)
68 } 68 }
69 69
70 STRING_OPTIONS.forEach { 70 STRING_OPTIONS.forEach {
71 commandLine.getOptionValues(it.name)?.forEach { value -> 71 commandLine.getOptionValues(it.name)?.forEach { value ->
72 val regexOptions = mutableSetOf<RegexOption>() 72 val regexOptions = mutableSetOf<RegexOption>()