mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-22 04:57:56 +01:00
revoke-key command: Allow for multiple '--with-key-password' options
This commit is contained in:
parent
42a16a4f6d
commit
375dd65789
1 changed files with 4 additions and 4 deletions
|
@ -19,8 +19,8 @@ class RevokeKeyCmd : AbstractSopCmd() {
|
|||
|
||||
@Option(names = ["--no-armor"], negatable = true) var armor = true
|
||||
|
||||
@Option(names = ["--with-key-password"], paramLabel = "PASSWORD")
|
||||
var withKeyPassword: String? = null
|
||||
@Option(names = ["--with-key-password"], paramLabel = "PASSWORD", arity = "0..*")
|
||||
var withKeyPassword: List<String> = listOf()
|
||||
|
||||
override fun run() {
|
||||
val revokeKey = throwIfUnsupportedSubcommand(SopCLI.getSop().revokeKey(), "revoke-key")
|
||||
|
@ -29,9 +29,9 @@ class RevokeKeyCmd : AbstractSopCmd() {
|
|||
revokeKey.noArmor()
|
||||
}
|
||||
|
||||
withKeyPassword?.let {
|
||||
for (passwordIn in withKeyPassword) {
|
||||
try {
|
||||
val password = stringFromInputStream(getInput(it))
|
||||
val password = stringFromInputStream(getInput(passwordIn))
|
||||
revokeKey.withKeyPassword(password)
|
||||
} catch (e: SOPGPException.UnsupportedOption) {
|
||||
val errorMsg =
|
||||
|
|
Loading…
Reference in a new issue