babashka / neil

A CLI to add common aliases and features to deps.edn-based projects
MIT License
377 stars 27 forks source link

`neil add` could provide usage help rather than crash #220

Closed teodorlu closed 5 months ago

teodorlu commented 5 months ago

Currently, neil add crashes. I think it would be more helpful to print the helptext, or possibly (and more work) to list all neil add subcommands.

$ neil add     
----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Data:     {:type :org.babashka/cli, :wrong-input nil, :all-commands ("dep" "test" "build" "kaocha" "nrepl"), :cause :input-exhausted, :opts {:deps-file "deps.edn"}}
Location: /opt/homebrew/bin/neil:1703:3

----- Context ------------------------------------------------------------------
1699: (defn neil-test [{:keys [opts]}]
1700:   (neil-test/neil-test opts))
1701: 
1702: (defn -main [& _args]
1703:   (cli/dispatch
        ^--- 
1704:    [{:cmds ["add" "dep"] :fn dep-add :args->opts [:lib]}
1705:     {:cmds ["add" "test"] :fn add-cognitect-test-runner}
1706:     {:cmds ["add" "build"] :fn add-build}
1707:     {:cmds ["add" "kaocha"] :fn add-kaocha}
1708:     {:cmds ["add" "nrepl"] :fn add-nrepl}

----- Stack trace --------------------------------------------------------------
babashka.cli/dispatch-tree/fn--25816       - <built-in>
babashka.cli/dispatch-tree/error-fn--25819 - <built-in>
babashka.cli/dispatch-tree                 - <built-in>
babashka.cli/dispatch                      - <built-in>
babashka.neil/-main                        - /opt/homebrew/bin/neil:1703:3
babashka.neil/-main                        - /opt/homebrew/bin/neil:1702:1
babashka.neil                              - /opt/homebrew/bin/neil:1764:3
babashka.neil                              - /opt/homebrew/bin/neil:1763:1

$ neil --version
neil 0.3.65
borkdude commented 5 months ago

Yes, agreed :)

teodorlu commented 5 months ago

Closing, I consider this solved.