Skip to content

Commit

Permalink
Do a different
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrink10 committed Dec 24, 2020
1 parent b57390f commit f26ea89
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/basilisp/cli_tools.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,9 @@
validate-fn)

;; Prepare the keyword arguments for ArgumentParser.add_argument
default (if-let [val-from-env (some-> (:env argument) (os/getenv))]
val-from-env
(:default argument))
kwargs {:default default
:const default
kwargs {:default (or (some-> (:env argument) (os/getenv))
(:default argument))
:const true
:action (cli-tools-action argument)
:nargs (if-let [nargs (:nargs argument)]
(cond-> nargs (keyword? nargs) (name))
Expand Down
2 changes: 0 additions & 2 deletions tests/basilisp/test_cli_tools.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@

{:flags ["--warn-on-shadowed-name"]
:help "if provided, emit warnings if a local name is shadowed by another local name"
:nargs 0
:env "BASILISP_WARN_ON_SHADOWED_NAME"
:group "compiler flags"}
{:flags ["--warn-on-shadowed-var"]
:help "if provided, emit warnings if a Var name is shadowed by a local name"
:nargs 0
:env "BASILISP_WARN_ON_SHADOWED_VAR"
:group "compiler flags"}]}]})]
(are [args ret] (is (= ret (dissoc (parse-args parser args) :handler)))
Expand Down

0 comments on commit f26ea89

Please sign in to comment.