Mercurial > cgi-bin > hgweb.cgi > PassMan
annotate src/main/kotlin/name/blackcap/passman/Subcommand.kt @ 27:3a3067ba673b
Add idle-time detection to interactive mode, clean up imports.
author | David Barts <n5jrn@me.com> |
---|---|
date | Sat, 27 Jul 2024 09:50:54 -0700 |
parents | ea65ab890f66 |
children |
rev | line source |
---|---|
0
a6cfdffcaa94
Initial commit, incomplete but it runs sorta.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
1 package name.blackcap.passman |
a6cfdffcaa94
Initial commit, incomplete but it runs sorta.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
2 |
a6cfdffcaa94
Initial commit, incomplete but it runs sorta.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
3 abstract class Subcommand() { |
a6cfdffcaa94
Initial commit, incomplete but it runs sorta.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
4 abstract fun run(args: Array<String>): Unit |
a6cfdffcaa94
Initial commit, incomplete but it runs sorta.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
5 } |
21
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
6 |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
7 // Replaces fatal errors that used to exit the process. |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
8 class SubcommandException(message: String? = null, cause: Throwable? = null, status: Int = 1) : Exception(message, cause) { |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
9 private val _status = status |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
10 val status: Int |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
11 get() = _status |
ea65ab890f66
More work to support interactive feature.
David Barts <n5jrn@me.com>
parents:
0
diff
changeset
|
12 } |