mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
test(cli): bare 'amy' exits 2; key generate rejects unknown flags
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CP4kfLCa3wWtE8Khy21Pkj
This commit is contained in:
@@ -165,7 +165,7 @@ class AwaitTimeout(
|
||||
private val STRICT_ACCOUNT_VERBS = setOf("init", "create", "login", "logoff", "whoami")
|
||||
|
||||
private suspend fun dispatch(argv: Array<String>): Int {
|
||||
if (argv.isEmpty() || argv[0] == "--help" || argv[0] == "-h") {
|
||||
if (argv.firstOrNull() == "--help" || argv.firstOrNull() == "-h") {
|
||||
printUsage()
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ object KeyCommands {
|
||||
rest,
|
||||
"key <generate|public|encrypt|decrypt|validate>",
|
||||
mapOf(
|
||||
"generate" to { _ -> generate() },
|
||||
"generate" to { tail -> generate(tail) },
|
||||
"public" to { tail -> public(tail) },
|
||||
"encrypt" to { tail -> encrypt(tail) },
|
||||
"decrypt" to { tail -> decrypt(tail) },
|
||||
@@ -134,7 +134,8 @@ object KeyCommands {
|
||||
return 0
|
||||
}
|
||||
|
||||
private fun generate(): Int {
|
||||
private fun generate(rest: Array<String>): Int {
|
||||
Args(rest).rejectUnknown()
|
||||
val id = Identity.create()
|
||||
Output.emit(
|
||||
mapOf(
|
||||
|
||||
Reference in New Issue
Block a user