comparison src/main/kotlin/name/blackcap/passman/Main.kt @ 21:ea65ab890f66

More work to support interactive feature.
author David Barts <n5jrn@me.com>
date Tue, 02 Jul 2024 11:27:39 -0700
parents 698c4a3d758d
children 07406c4af4a5
comparison
equal deleted inserted replaced
20:4391afcf6bd0 21:ea65ab890f66
13 error("expecting subcommand") 13 error("expecting subcommand")
14 exitProcess(2) 14 exitProcess(2)
15 } 15 }
16 val subcommand = args[0]; 16 val subcommand = args[0];
17 val scArgs = args.sliceArray(1 until args.size) 17 val scArgs = args.sliceArray(1 until args.size)
18 Database.default = Database.open()
18 runSubcommand(subcommand, scArgs) 19 runSubcommand(subcommand, scArgs)
19 } 20 }
20 21
21 fun runSubcommand(name: String, args: Array<String>): Unit { 22 fun runSubcommand(name: String, args: Array<String>): Unit {
22 val instance = getInstanceForClass(getClassForSubcommand(name)) 23 val instance = getInstanceForClass(getClassForSubcommand(name))