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

Add Parent FlagSet #357

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

Conversation

fahedouch
Copy link

Persistent flags (shorthand) of cmd's parents conflict with cmd's shorthand flags. We faced this issue multiple time within nerdctl (containerd/nerdctl#1334) . This idea of this PR is to ignore the InheritedFlags when there is conflict with flag and shorthand
Signed-off-by: fahed dorgaa [email protected]

Signed-off-by: fahed dorgaa <[email protected]>
@CLAassistant
Copy link

CLAassistant commented Sep 5, 2022

CLA assistant check
All committers have signed the CLA.

@@ -896,6 896,19 @@ func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
})
}

// AddParentFlagSet adds parent FlagSet to f. If a flag and shorthand is already present in f
// the flag from parentSet will be ignored.

Choose a reason for hiding this comment

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

Needs unit testing

@fahedouch fahedouch marked this pull request as draft September 10, 2022 22:12
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.

3 participants