#1336: --force as global opt (#1374)

This commit is contained in:
Bob 2022-09-24 04:59:34 -04:00 committed by GitHub
parent 42ebb92c5d
commit 78cbdd1d82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -7,6 +7,7 @@ A preview of the next release can be installed from
## Unreleased
- [#1336](https://github.com/babashka/babashka/issues/1336): tasks subcommand doesn't work with global --force option ([@bobisageek](https://github.com/bobisageek))
- [#1340](https://github.com/babashka/babashka/issues/1340): `defprotocol` are methods missing `:doc` metadata ([@bobisageek](https://github.com/bobisageek))
- [#1368](https://github.com/babashka/babashka/issues/1368): `-x`: do not pick up on aliases in `user` ns
- [#1367](https://github.com/babashka/babashka/issues/1367): Fix line number in clojure.test output ([@retrogradeorbit](https://github.com/retrogradeorbit))

View file

@ -552,9 +552,6 @@ Use bb run --help to show this help output.
("--verbose") (recur (next options)
(assoc opts-map
:verbose? true))
("--force") (recur (next options)
(assoc opts-map
:force? true))
("--describe") (recur (next options)
(assoc opts-map
:describe? true))
@ -699,6 +696,9 @@ Use bb run --help to show this help output.
("--init")
(recur (nnext options) (assoc opts-map :init (second options)))
("--force")
(recur (next options) (assoc opts-map :force? true))
("--config")
(recur (nnext options) (assoc opts-map :config (second options)))

View file

@ -60,7 +60,12 @@
(is (:feature/xml v)))
(is (= {:force? true} (parse-opts ["--force"])))
(is (= {:main "foo", :command-line-args '("-h")} (parse-opts ["-m" "foo" "-h"])))
(is (= {:main "foo", :command-line-args '("-h")} (parse-opts ["-m" "foo" "--" "-h"]))))
(is (= {:main "foo", :command-line-args '("-h")} (parse-opts ["-m" "foo" "--" "-h"])))
(is (= {:force? true :list-tasks true :command-line-args nil} (parse-opts ["--force" "tasks"])))
(is (= {:force? true :run "sometask" :command-line-args nil} (parse-opts ["--force" "run" "sometask"])))
(is (= {:force? true :repl true} (parse-opts ["--force" "repl"])))
(is (= {:force? true :clojure true :command-line-args '("-M" "-r")}
(parse-opts ["--force" "clojure" "-M" "-r"]))))
(deftest version-test
(is (= [1 0 0] (main/parse-version "1.0.0-SNAPSHOT")))