Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Jul 25, 2023
1 parent 19c6014 commit 707d6b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions traverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ loop:

if localInFlag != nil && (len(localInFlag.Args) == 0 || localInFlag.Args[0] == "") && (!localInFlag.IsOptarg() || strings.HasSuffix(localInFlag.Prefix, string(localInFlag.OptargDelimiter()))) { // TODO && len(context.Value) > 2 {
// TODO check if empty prefix
LOG.Printf("removing shorthand %#v from flag series since it is missing its argument\n", localInFlag.Shorthand)
LOG.Printf("prefix %#v", localInFlag.Prefix)
toParse = append(toParse, strings.TrimSuffix(strings.TrimSuffix(localInFlag.Prefix, string(localInFlag.OptargDelimiter())), localInFlag.Shorthand))
suffix := localInFlag.Prefix[strings.LastIndex(localInFlag.Prefix, localInFlag.Shorthand):]
LOG.Printf("removing suffix %#v since it is a flag missing its argument\n", suffix)
toParse = append(toParse, strings.TrimSuffix(localInFlag.Prefix, suffix))
} else {
LOG.Printf("adding shorthand flag %#v", context.Value)
toParse = append(toParse, context.Value)
Expand Down

0 comments on commit 707d6b1

Please sign in to comment.