Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI flags broken after kingpin migration #447

Closed
pgollangi opened this issue Jun 27, 2023 · 1 comment · Fixed by #460
Closed

CLI flags broken after kingpin migration #447

pgollangi opened this issue Jun 27, 2023 · 1 comment · Fixed by #460

Comments

@pgollangi
Copy link

Describe the bug
All nginx-prometheus-exporter supposed to work with single hyphen, for example -nginx.scrape-uri=http://localhost:8080/metrics as it was the case with GoLang flags.

However this is no longer the case after migrating CLI parser to alecthomas/kingpin.
CLI flags with single hyphens considered as short flags and reporting errors.

For example following command giving error:

$ nginx-prometheus-exporter -nginx.scrape-uri=http://localhost:8080/metrics
nginx-prometheus-exporter: error: unknown short flag '-n', try --help

To reproduce
Steps to reproduce the behavior:

  1. Run nginx-prometheus-exporter from source or build CLI binary from main branch and run nginx-prometheus-exporter

Expected behavior
nginx-prometheus-exporter should accept long flags with single hyphens

Your environment

  • Version of the Prometheus exporter - revision 3d70ede5acc92bb50dd0fc9caab80cdf1a83082e
  • Version of Docker/Kubernetes: 1.24
  • [if applicable] Kubernetes platform: GKE
  • Using NGINX or NGINX Plus: NGINX
@lucacome
Copy link
Member

Hi @pgollangi

we haven't released a new version with those changes yet and the plan was to have a breaking change release (bump to v1.0.0) because of that and other changes.
We could actually add a function to transform the single dash to a double and maybe add a warning that the single one is being deprecated 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants