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

flagcodec: enable flag normalization #255

Merged

Conversation

ffromani
Copy link
Collaborator

@ffromani ffromani commented Nov 29, 2023

Following the conventions outlined in RATIONALE.md,
the pflag packages allows using both --v and -v
(double or single dashes for single-letter flags), but
the flagcodec package wasn't behaving the same, treating
the two flags as different.

We add options to conform to our own rationale and to
be more compatible with pflag.

@ffromani
Copy link
Collaborator Author

needs to be backportable

@ffromani ffromani force-pushed the flagcodec-pflag-compat branch from d7b7a0f to d994faa Compare November 29, 2023 09:22
@ffromani ffromani force-pushed the flagcodec-pflag-compat branch 2 times, most recently from 0412dd9 to 1e42440 Compare November 29, 2023 15:09
Following the conventions outlined in RATIONALE.md,
the pflag packages allows using both `--v` and `-v`
(double or single dashes for single-letter flags), but
the flagcodec package  wasn't behaving the same, treating
the two flags as different.

We add options to conform to our own rationale and to
be more compatible with pflag.

Signed-off-by: Francesco Romani <[email protected]>
Always enable normalization in the deployer codebase.
The golang flag package also allows single or double dash
for single-letter flags: https://pkg.go.dev/flag#hdr-Command_line_flag_syntax

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani force-pushed the flagcodec-pflag-compat branch from 1e42440 to 99b7fc6 Compare November 29, 2023 16:31
@ffromani ffromani merged commit eeff2df into k8stopologyawareschedwg:main Nov 29, 2023
4 checks passed
@ffromani ffromani deleted the flagcodec-pflag-compat branch November 29, 2023 16:38
@ffromani ffromani changed the title WIP: flagcodec: enable flag normalization flagcodec: enable flag normalization Nov 29, 2023
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.

1 participant