Added test for command suggestion
diff --git a/command_test.go b/command_test.go
index 8507782..a093e15 100644
--- a/command_test.go
+++ b/command_test.go
@@ -115,6 +115,23 @@
assertError(t, err, ErrCommandRequired, "Please specify one command of: add or remove")
}
+func TestCommandEstimate2(t *testing.T) {
+ var opts = struct {
+ Value bool `short:"v"`
+
+ Cmd1 struct {
+ } `command:"remove"`
+
+ Cmd2 struct {
+ } `command:"add"`
+ }{}
+
+ p := NewParser(&opts, None)
+ _, err := p.ParseArgs([]string{"rmive"})
+
+ assertError(t, err, ErrUnknownCommand, "Unknown command `rmive', did you mean `remove'?")
+}
+
type testCommand struct {
G bool `short:"g"`
Executed bool