mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-12-23 05:17:58 +01:00
revoke-key command: Allow for multiple '--with-key-password' options
This commit is contained in:
parent
61f3bf14c5
commit
8843d217e4
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