-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression in handling flag-values starting with hyphen
Fix for a regression between v1.22.1 and v1.22.2, where flag values starting with a hyphen would be parsed as a flag: runc update test_update --memory-swap -1 Incorrect Usage: flag provided but not defined: -1 This problem was caused by `reorderArgs()` not properly checking if the next arg in the list was a value for the flag (and not the next flag); Before this patch: args before reordering: --opt,--opt-value,arg1 args after reordering: --opt,arg1,--opt-value args before reordering: --opt,--opt-value,arg1,arg2 args after reordering: --opt,arg1,--opt-value,arg2 args before reordering: arg1,--opt,--opt-value,arg2 args after reordering: --opt,arg2,arg1,--opt-value After this patch is applied: args before reordering: --opt,--opt-value,arg1 args after reordering: --opt,--opt-value,arg1 args before reordering: --opt,--opt-value,arg1,arg2 args after reordering: --opt,--opt-value,arg1,arg2 args before reordering: arg1,--opt,--opt-value,arg2 args after reordering: --opt,--opt-value,arg1,arg2 Co-authored-by: lynn (they) <lynncyrin@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Loading branch information
1 parent
fe4a429
commit 2add9e1
Showing
2 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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