Skip to content

Commit b9eb289

Browse files
committed
readme: Add a paragraph about the difference between this and Cobra
1 parent cd7c315 commit b9eb289

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,13 @@ func main() {
6262
fmt.Printf("Executed %s.%s.%s with localFlagName %s and and persistentFlagName %s.\n", root.name, lvl1.name, lvl2.name, lvl2.localFlagName, root.persistentFlagName)
6363
}
6464
```
65+
66+
67+
## Differences to Cobra
68+
69+
You have access to the `*cobra.Command` pointer so there's not much you cannot do with this project compared to the more low-level Cobra, but there's one small, but imortant difference:
70+
71+
Cobra only treats the first level of misspelled commands as an `unknown command` with "Did you mean this?" suggestions, see [see this issue](https://github.com/spf13/cobra/pull/1500) for more context. The reason this is, is because of the ambiguity between sub command names and command arguments, but that is throwing away a very useful feature for not a very good reason. We recently rewrote [Hugo's CLI](https://github.com/gohugoio/hugo) using this poackage, and found only one sub command that needed to be adjusted to avoid this ambiguity.
72+
73+
74+

0 commit comments

Comments
 (0)