Skip to content

Add opt-out for --no-* boolean switch aliases#27

Closed
t-kalinowski wants to merge 1 commit into
mainfrom
feature/negative-alias-switches
Closed

Add opt-out for --no-* boolean switch aliases#27
t-kalinowski wants to merge 1 commit into
mainfrom
feature/negative-alias-switches

Conversation

@t-kalinowski

Copy link
Copy Markdown
Member

Summary

Adds a negative_alias: false annotation for boolean switches so apps can expose only the positive flag form, such as --version, without also accepting or documenting --no-version.

Closes #24.

User-facing changes

  • Boolean switches can now opt out of generated --no-* aliases with #| negative_alias: false.
  • Help output omits the generated negative alias when disabled.
  • Disabled negative aliases are rejected as unknown arguments.
  • README and NEWS document the new annotation.

Internal changes

  • Added shared has_negative_alias() logic using exact [[ lookup to avoid R $ partial matching.
  • Updated argument parsing and help formatting to respect the annotation.
  • Added regression coverage for disabled aliases, true-default switches, and accidental negative partial matching.

@t-kalinowski

Copy link
Copy Markdown
Member Author

Closed in favor of #28

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.

Disabling automatic creation of --no-* flag for boolean flags

1 participant