Mercurial > cgi-bin > hgweb.cgi > PassMan
annotate src/main/kotlin/name/blackcap/passman/QuitSubcommand.kt @ 26:69526ae8c8de
Allow list --name to be abbreviated -n, since it is so commonly used.
author | David Barts <n5jrn@me.com> |
---|---|
date | Fri, 05 Jul 2024 10:11:31 -0700 |
parents | 2188b2f13326 |
children |
rev | line source |
---|---|
24
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
1 package name.blackcap.passman |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
2 |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
3 // This command does nothing except print a help message if requested, |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
4 // so that "help quit" works. The actual quit logic is hard-coded in |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
5 // Main.kt (and needs to be, so that exit status is correct). |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
6 class QuitSubcommand(): Subcommand() { |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
7 override fun run(args: Array<String>) { |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
8 if (args.isNotEmpty() && (args[0] == "-h" || args[0].startsWith("--h"))) { |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
9 println("usage: passman quit [options]") |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
10 println(" -h,--help Print this help message.") |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
11 } |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
12 } |
2188b2f13326
Make some minor tweaks to the help system.
David Barts <n5jrn@me.com>
parents:
diff
changeset
|
13 } |