Skip to content

Commit

Permalink
Use opts under org.babashka.cli ns
Browse files Browse the repository at this point in the history
  • Loading branch information
Sohalt committed Mar 21, 2024
1 parent 38f5c16 commit ef3539e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/babashka/cli.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,14 @@
error-fn*))
[opt shell cmdline] args
_ (case opt
"--babashka.cli/completion-snippet"
"--org.babashka.cli/completion-snippet"
(if-let [command-name (get-in opts [:completion :command])]
(do (print-completion-shell-snippet (keyword shell) command-name)
(System/exit 0))
(binding [*out* *err*]
(println "Need `:completion {:command \"<name>\"}` in opts to support shell completions")
(println "Need `:completion {:command \"<name>\"}` in `opts` to support shell completions")
(System/exit 1)))
"--babashka.cli/complete"
"--org.babashka.cli/complete"
(do (print-opts-completions (keyword shell) opts cmdline)
(System/exit 0))
:noop)
Expand Down Expand Up @@ -818,9 +818,9 @@ complete --command %s --no-files --arguments \"(_babashka_cli_dynamic_completion
(let [command-name (get-in opts [:completion :command])
[opt shell cmdline] args]
(case opt
"--babashka.cli/completion-snippet"
"--org.babashka.cli/completion-snippet"
(print-completion-shell-snippet (keyword shell) command-name)
"--babashka.cli/complete"
"--org.babashka.cli/complete"
(print-dispatch-completions (keyword shell) tree cmdline)
(let [{:as res :keys [cmd-info error available-commands]}
(dispatch-tree' tree args opts)
Expand Down

0 comments on commit ef3539e

Please sign in to comment.