-
-
Notifications
You must be signed in to change notification settings - Fork 19
Closed
Description
It would be helpful to have the cmds
Line 638 in 05868bf
| :dispatch cmds |
:no-match and :input-exhausted cases, because it's helpful to know how far dispatch traversed the command tree until it encountered the error to give better error messages.
Specifically, if I have
(def cmd-table
[{:cmds ["foo" "bar"] :fn identity}
{:cmds ["foo" "baz"] :fn identity}])
(dispatch cmd-table ["foo" "quux"] {:error-fn identity})
;; => {:type :org.babashka/cli, :wrong-input "quux", :all-commands ("bar" "baz"), :cause :no-match, :opts {}}if I had the prefix "foo", I could genenrate an error message that lists all valid commands with prefix "foo" (i.e. "foo bar" "foo baz").
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels