Fix help
This commit is contained in:
parent
6e58278f9d
commit
e4d82b87be
2 changed files with 7 additions and 6 deletions
|
|
@ -154,7 +154,7 @@ Use -- to separate script command line args from bb command line args.
|
|||
task (get-in @bb-edn [:tasks k])
|
||||
{:keys [:args]} (decode-task task)
|
||||
main (first args)
|
||||
help-text (:task/help (meta task))]
|
||||
help-text (:help (meta task))]
|
||||
(if help-text
|
||||
[(println help-text) 0]
|
||||
(if main
|
||||
|
|
|
|||
|
|
@ -91,12 +91,13 @@
|
|||
(with-config {:tasks {:describe [:babashka "-e" "(+ 1 2 3)"]}}
|
||||
(is (= 6 (bb :describe)))))
|
||||
|
||||
#_(deftest help-task-test
|
||||
(with-config {:tasks {:cool-task ^{:task/help "Usage: bb :cool-task
|
||||
(deftest help-task-test
|
||||
(with-config "{:tasks {:cool-task
|
||||
^{:help \"Usage: bb :cool-task
|
||||
|
||||
Addition is a pretty advanced topic. Let us start with the identity element
|
||||
0. ..."}
|
||||
[:babashka "-e" "(+ 1 2 3)"]}}
|
||||
Addition is a pretty advanced topic. Let us start with the identity element
|
||||
0. ...\"}
|
||||
[:babashka -e (+ 1 2 3)]}}"
|
||||
(is (str/includes? (apply test-utils/bb nil
|
||||
(map str [:help :cool-task]))
|
||||
"Usage: bb :cool-task"))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue