diff --git a/CHANGELOG.md b/CHANGELOG.md index 148c6c7c..83219aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,12 @@ For a list of breaking changes, check [here](#breaking-changes). -## 0.3.1 +## 0.3.1 (unreleased) + +Preliminary docs: + +bb.edn: https://book.babashka.org/master.html#_bb_edn +-m with fully qualified symbol: https://book.babashka.org/master.html#_invoking_a_main_function Babashka proper: diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 3a7a624d..1ff1d672 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -104,8 +104,6 @@ (defn print-help [_ctx _command-line-args] (println (str "Babashka v" version)) - ;; (println (str "sci v" (str/trim (slurp (io/resource "SCI_VERSION"))))) - (println) (println " Help: @@ -114,6 +112,14 @@ Help: describe Print an EDN map with information about this version of babashka. doc Print docstring of var or namespace. Requires namespace if necessary. +Evaluation: + + -e, --eval Evaluate an expression. + -f, --file Evaluate a file. + -cp, --classpath Classpath to use. + -m, --main Call the -main function from a namespace or call a fully qualified var. + --verbose Print debug information and entire stacktrace in case of exception. + REPL: Usage: [port/host] [classpath-opt] @@ -133,15 +139,7 @@ Packaging: uberjar [eval-opts] Similar to --uberscript but creates jar file. -Evaluation: - - -e, --eval Evaluate an expression. - -f, --file Evaluate a file. - -cp, --classpath Classpath to use. - -m, --main Call the -main function from a namespace or call a fully qualified var. - --verbose Print debug information and entire stacktrace in case of exception. - -In- and output flags: +In- and output flags (to be used with -e on the command line): -i Bind *input* to a lazy seq of lines from stdin. -I Bind *input* to a lazy seq of EDN values from stdin. diff --git a/test/babashka/bb_edn_test.clj b/test/babashka/bb_edn_test.clj index f99d54b2..41ad4e55 100644 --- a/test/babashka/bb_edn_test.clj +++ b/test/babashka/bb_edn_test.clj @@ -36,3 +36,12 @@ (with-config '{:deps {medley/medley {:mvn/version "1.3.0"}}} (is (= '{1 {:id 1}, 2 {:id 2}} (bb "-e" "(require 'medley.core)" "-e" "(medley.core/index-by :id [{:id 1} {:id 2}])"))))) + +;; TODO: +;; Do we want to support the same parsing as the clj CLI? +;; Or do we want `--aliases :foo:bar` +;; Let's wait for a good use case +#_(deftest alias-deps-test + (with-config '{:aliases {:medley {:deps {medley/medley {:mvn/version "1.3.0"}}}}} + (is (= '{1 {:id 1}, 2 {:id 2}} + (bb "-A:medley" "-e" "(require 'medley.core)" "-e" "(medley.core/index-by :id [{:id 1} {:id 2}])")))))