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

Allow to disable requirement for uncapitalized descriptions #155

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jirutka
Copy link

@jirutka jirutka commented Jan 9, 2023

This strict requirement makes sense only for programs designed for Fuchsia, no other system has this convention.

This commit adds a type-level attribute lax_description that disables the option descriptions validation when present.

This strict requirement makes sense only for programs designed for
Fuchsia, no other system has this convention.

This commit adds a type-level attribute `lax_description` that
disables the option descriptions validation when present.
@google-cla
Copy link

google-cla bot commented Jan 9, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

jirutka added a commit to jirutka/argh that referenced this pull request Jan 9, 2023
@@ -6,7 +6,12 @@ use {argh::FromArgs, std::fmt::Debug};

#[derive(FromArgs, PartialEq, Debug)]
/// Top-level command.
#[argh(lax_descriptions)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like a weird place to add this to the example.

/// Test that descriptions can start with any case when
/// the type attribute `lax_descriptions` is specified.
#[derive(FromArgs)]
#[argh(lax_descriptions)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure I like the name "lax_descriptions". Seems a bit generic.

check_option_description(errors, d.content.value().trim(), d.content.span());
if !type_attrs.lax_descriptions {
if let Some(d) = &this.description {
check_option_description(errors, d.content.value().trim(), d.content.span());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should change the behavior of check_option_description rather than skipping it entirely when the option is set.

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 this pull request may close these issues.

2 participants