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 negation flags to the CLI #3050

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Add negation flags to the CLI #3050

merged 1 commit into from
Apr 17, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Now that we can pick up configuration values from persistent files, we need to enable users to disable those values from the CLI. For example, if a user has emit_index_url = true in the configuration file, they should be able to do --no-emit-index-url on the command-line. This PR adds support for such negations, following the same patterns we use in Ruff.

@charliermarsh charliermarsh added the configuration Settings and such label Apr 16, 2024
pub(crate) no_header: bool,

#[arg(long, overrides_with("no_header"), hide = true)]
pub(crate) header: bool,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ones are a bit weird, because the hidden value is --header and the visible value (and value in the configuration file) is --no-header / no-header = true. Like, in theory it should be... --no-no-header?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay as-is.

@charliermarsh charliermarsh marked this pull request as ready for review April 16, 2024 03:59
@charliermarsh
Copy link
Member Author

Added negation flags for all commands...

Base automatically changed from charlie/workspace-v to main April 17, 2024 17:59
@charliermarsh charliermarsh merged commit f846fdc into main Apr 17, 2024
38 checks passed
@charliermarsh charliermarsh deleted the charlie/workspace-vi branch April 17, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Settings and such
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants