go-acme / lego

Let's Encrypt/ACME client and library written in Go
https://go-acme.github.io/lego/
MIT License
7.96k stars 1.02k forks source link

Boolean option --always-deactivate-authorizations requires string value. #1776

Open Maokaman1 opened 1 year ago

Maokaman1 commented 1 year ago

Welcome

What did you expect to see?

Does it make any sense to require a String value for the --always-deactivate-authorizations boolean option? Other boolean options like --no-bundle, --must-staple behave as they should.

https://github.com/go-acme/lego/blob/a7b11e0447290f8a8a6e1b38317fbf7e604ca890/cmd/cmd_run.go#L50-L52 https://github.com/go-acme/lego/blob/a7b11e0447290f8a8a6e1b38317fbf7e604ca890/cmd/cmd_renew.go#L70-L72

What did you see instead?

I get flag needs an argument: -always-deactivate-authorizations error.

How do you use lego?

Binary

Reproduction steps

lego --email test@test.test -d site.com --dns manual run --always-deactivate-authorizations

Version of lego

lego version v4.9.1 linux/amd64

Logs

```console # lego --email test@test.test -d site.com --dns manual run --always-deactivate-authorizations Incorrect Usage: flag needs an argument: -always-deactivate-authorizations NAME: lego run - Register an account, then create and install a certificate USAGE: lego run [command options] [arguments...] OPTIONS: --always-deactivate-authorizations value Force the authorizations to be relinquished even if the certificate request was successful. --must-staple Include the OCSP must staple TLS extension in the CSR and generated certificate. Only works if the CSR is generated by lego. (default: false) --no-bundle Do not create a certificate bundle by adding the issuers certificate to the new certificate. (default: false) --preferred-chain value If the CA offers multiple certificate chains, prefer the chain with an issuer matching this Subject Common Name. If no match, the default offered chain will be used. --run-hook value Define a hook. The hook is executed when the certificates are effectively created. 2022/11/28 20:02:51 flag needs an argument: -always-deactivate-authorizations ```

Go environment (if applicable)

No response

Maokaman1 commented 1 year ago

Fixing this issue will break someone's scripts though. FYI, @MartinWeindel.

ldez commented 1 year ago

Hello,

It's just a mistake that I did in #1480

Yes it's not the right type, I think this option is used by only a few people, so maybe we can break :thinking:

MartinWeindel commented 1 year ago

Yes it's not the right type, I think this option is used by only a few people, so maybe we can break

My bad, I missed that. I agree, it should be a BoolFlag.