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