mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-27 14:48:02 +01:00
revoke-key command: Allow for multiple '--with-key-password' options
This commit is contained in:
parent
ffb8d297d3
commit
19818f6e9d
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