Skip to content

Adding support for positive boolean options in CLI#1686

Merged
ayush3797 merged 13 commits intomainfrom
dev/agarwalayush/supportForPositiveBooleanFlags
Sep 15, 2023
Merged

Adding support for positive boolean options in CLI#1686
ayush3797 merged 13 commits intomainfrom
dev/agarwalayush/supportForPositiveBooleanFlags

Conversation

@ayush3797
Copy link
Copy Markdown
Contributor

@ayush3797 ayush3797 commented Sep 5, 2023

Why make this change?

To adjust CLI boolean options to properly allow true/false values as per: #1679

What is this change?

  1. Added new options - --rest.enabled and --graphql.enabled to dab init options.
  2. Introduce an enum CliBool with values - None,True,False, to represent boolean options in CLI. When the option is omitted from the init command, the value of CliBool.None would be assigned to the option, or else appropriate True/False value would be parsed out and assigned to the option.
  3. When both positive and negative flags are included in the init command then:
    • Config generation fails when the semantics differ.
    • If the semantics match, then appropriate value is assigned to Runtime.Rest.Enabled/Runtime.GraphQL.Enabled properties.
  4. When only one of --rest.enabled/--rest.disabled (or corresponding flags for graphql) option is included in the init command, the value assigned to that option is honored.

How was this tested?

  • Unit Tests - are added via EndToEndTests.TestEnabledDisabledFlagsForApis test confirming the behavior for different cases.

@ayush3797 ayush3797 self-assigned this Sep 5, 2023
@ayush3797 ayush3797 added enhancement New feature or request cli labels Sep 5, 2023
@ayush3797 ayush3797 linked an issue Sep 5, 2023 that may be closed by this pull request
Comment thread src/Config/ObjectModel/CliBool.cs Outdated
@seantleonard seantleonard added this to the 0.10rc milestone Sep 6, 2023
Comment thread src/Cli/ConfigGenerator.cs Outdated
@seantleonard seantleonard modified the milestones: 0.10rc, 0.9rc Sep 12, 2023
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs Outdated
Comment thread src/Cli/ConfigGenerator.cs
Copy link
Copy Markdown
Contributor

@seantleonard seantleonard left a comment

Choose a reason for hiding this comment

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

Looks good! one last question

@ayush3797 ayush3797 enabled auto-merge (squash) September 15, 2023 08:55
@ayush3797 ayush3797 merged commit 1e7f6f1 into main Sep 15, 2023
@ayush3797 ayush3797 deleted the dev/agarwalayush/supportForPositiveBooleanFlags branch September 15, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Enhancement] Boolean values in CLI

4 participants