cobra
cobra copied to clipboard
Share more code between Traverse and stripFlags
Includes, and closes #616
Pls ignore my previous comment.
On Thursday, 18 January 2018, Daniel Nephin [email protected] wrote:
@dnephin commented on this pull request.
In command.go https://github.com/spf13/cobra/pull/617#discussion_r162207585:
@@ -491,6 +468,30 @@ Loop: return commands }
+func hasDefaultValue(name string, fs *flag.FlagSet) bool {
- flag := fs.Lookup(name)
- if flag == nil {
return false
- }
- return flag.NoOptDefVal != "" +}
+func isShortFlagWithNoDefaultValue(arg string, flags *flag.FlagSet) bool {
If you would rather I omit the refactoring, and only add the test case for now, I'm fine with that.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spf13/cobra/pull/617#discussion_r162207585, or mute the thread https://github.com/notifications/unsubscribe-auth/AAu9Mr3Hg0mkEw4wXE27zq41D-4-DXHmks5tLn5SgaJpZM4Rhztc .
@dnephin looks like this needs a rebase 😅
@dnephin @eparis This looks worth merging. Any interest in updating it to work with tip?
This PR is being marked as stale due to a long period of inactivity
+label:needs investigation
It seems that this PR is worth merging in. It has a test and seems the work needed to be done here is just fixing conflicts. @dnephin Any interest in fixing the conflict? We can try and merge it in soon after if still applicable. WDYT?