Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 57eada9

Browse files
committed
More debugging
1 parent 1660fdd commit 57eada9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/parsing.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,26 @@ func usageFrom(path string) (string, cobra.PositionalArgs, error) {
7373

7474
parts := strings.Split(line, " ")
7575
if len(parts) == 1 {
76+
logrus.Debug("No args allowed")
7677
return line, cobra.NoArgs, nil
7778
}
7879

7980
var required, optional int
8081
for _, i := range parts[1:] {
8182
if strings.HasPrefix(i, "[") && strings.HasSuffix(i, "]") {
83+
logrus.Debug("Found optional arg: ", i)
8284
optional++
8385
} else {
86+
logrus.Debug("Found required arg: ", i)
8487
required++
8588
}
8689
}
8790

91+
logrus.Debug("Arg range of ", required, " and ", required+optional, " set")
8892
return match[1], cobra.RangeArgs(required, required+optional), nil
8993
}
9094
}
95+
logrus.Debug("Any args allowed")
9196
return filepath.Base(path), cobra.ArbitraryArgs, nil
9297
}
9398

0 commit comments

Comments
 (0)