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

Add support for implied options #733

Open
Radiergummi opened this issue Sep 2, 2024 · 0 comments
Open

Add support for implied options #733

Radiergummi opened this issue Sep 2, 2024 · 0 comments

Comments

@Radiergummi
Copy link

In some cases, commands have options that imply other options, say:

  -m, --metrics           - Enable the metrics collector.
      --metrics-endpoint  - Endpoint to serve metrics on.
                            Implies --metrics. Default value: "/metrics".

If a metrics endpoint is given, the metrics feature is implied to be enabled as well. This should be configurable via a new option implies?: string[] that nicely complements depends and conflicts:

  .option("-m, --metrics", "Enable the metrics collector.")
  .option(
    "--metrics-endpoint",
    "Endpoint to serve metrics on.",
    {
      default: "/metrics",
      implies: ["metrics"]
    }
  )
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

No branches or pull requests

1 participant