Mercurial > cgi-bin > hgweb.cgi > PassMan
comparison src/main/kotlin/name/blackcap/passman/ReadSubcommand.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 | c69665ff37d0 |
comparison
equal
deleted
inserted
replaced
8:698c4a3d758d | 9:72619175004e |
---|---|
28 if (commandLine.hasOption(HELP)) { | 28 if (commandLine.hasOption(HELP)) { |
29 HelpFormatter().printHelp("$SHORTNAME read", options) | 29 HelpFormatter().printHelp("$SHORTNAME read", options) |
30 exitProcess(0) | 30 exitProcess(0) |
31 } | 31 } |
32 if (commandLine.args.isEmpty()) { | 32 if (commandLine.args.isEmpty()) { |
33 error("expecting site name") | 33 die("expecting site name", 2) |
34 } | 34 } |
35 if (commandLine.args.size > 1) { | 35 if (commandLine.args.size > 1) { |
36 error("unexpected trailing arguments") | 36 die("unexpected trailing arguments", 2) |
37 } | 37 } |
38 val nameIn = commandLine.args[0]; | 38 val nameIn = commandLine.args[0]; |
39 val db = Database.open() | 39 val db = Database.open() |
40 val id = db.makeKey(nameIn) | 40 val id = db.makeKey(nameIn) |
41 | 41 |