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

Support for boolean flags without explicit values #215

Merged
merged 2 commits into from Jun 5, 2023

Conversation

joseluisq
Copy link
Collaborator

Description

This PR adds support for hybrid boolean flags which applies to large and short boolean flag variants.

Implicit example:

static-web-server --root public/ --compression -z

Explicit example (note the are no spaces in between):

static-web-server --root public/ --compression=false -z

Note also that this PR migrates to the latest clap v4.

Related Issue

Resolves #209 (post enhancement of #211)

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

the following boolean flag variants are now possible.

implicit example:
--compression
-x

explicit example (note the are not spaces in between):
--compression=true
--compression=false
-x=true
-x=false
@joseluisq joseluisq self-assigned this Jun 4, 2023
@joseluisq joseluisq added enhancement New feature or request v2 v2 release labels Jun 4, 2023
@joseluisq
Copy link
Collaborator Author

@mac-chaffee It would be great a test from your side.

@joseluisq joseluisq force-pushed the boolean-flags-without-value-support branch from 59f2258 to 8aefcab Compare June 4, 2023 23:22
@mac-chaffee
Copy link
Contributor

tested with --security-headers and --security-headers=false and it worked

@joseluisq
Copy link
Collaborator Author

tested with --security-headers and --security-headers=false and it worked

I also will send another PR to fix --security-headers not set in config.

@joseluisq joseluisq force-pushed the boolean-flags-without-value-support branch from 8aefcab to 7970383 Compare June 4, 2023 23:58
@joseluisq joseluisq merged commit 2150c74 into master Jun 5, 2023
27 checks passed
@joseluisq joseluisq deleted the boolean-flags-without-value-support branch June 5, 2023 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 v2 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Boolean options without a value (--http2) are silently ignored
2 participants