Skip to content

Add Parent FlagSet#357

Draft
fahedouch wants to merge 1 commit into
spf13:masterfrom
fahedouch:AddParentFlagSet
Draft

Add Parent FlagSet#357
fahedouch wants to merge 1 commit into
spf13:masterfrom
fahedouch:AddParentFlagSet

Conversation

@fahedouch

Copy link
Copy Markdown

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 fahed.dorgaa@gmail.com

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
@CLAassistant

CLAassistant commented Sep 5, 2022

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread flag.go
}

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

Copy link
Copy Markdown

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