mflag: strip quotes in certain forms from flag values#6147
Merged
vieux merged 2 commits intomoby:masterfrom Jun 2, 2014
Merged
mflag: strip quotes in certain forms from flag values#6147vieux merged 2 commits intomoby:masterfrom
vieux merged 2 commits intomoby:masterfrom
Conversation
This patch improves the mflag package to ensure that things arguments to mflag such as `-flag="var"` or `-flag='var'` have the quotes stripped from the value (to mirror the getopt functionality for similar flags). Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <[email protected]> (github: cyphar)
This patch adds some tests to ensure that quoted flags are properly handled by the mflag package. Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <[email protected]> (github: cyphar)
Contributor
|
LGTM |
vieux
added a commit
that referenced
this pull request
Jun 2, 2014
…al-form mflag: strip quotes in certain forms from flag values
This was referenced Aug 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the form
-flag="val"or--flag="val", the value is quoted when parsed (while in conventional libraries such asgetopt, these types of flags are stripped of quotes). This patchset fixed this, and adds some unit tests to make sure that they work.Docker-DCO-1.1-Signed-off-by: Aleksa Sarai [email protected] (github: cyphar)
Closes #6142
/cc @vieux