We're updating the issue view to help you get more done. 

cljs.main: Validate -O and -t

Description

Since -O and -t take on an enumerated set of values, validate them early.

This can potentially avoid some cryptic error reports. For example, supplying adv instead of advanced derails in an odd way:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 $ clj -m cljs.main -O adv -c chambered.core WARNING: :preloads should only be specified with :none optimizations Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :-find-sources of protocol: #'cljs.closure/Compilable found for class: nil at clojure.core$_cache_protocol_fn.invokeStatic(core_deftype.clj:583) at clojure.core$_cache_protocol_fn.invoke(core_deftype.clj:575) at cljs.closure$eval6819$fn__6833$G__6810__6840.invoke(closure.clj:511) at cljs.closure$build$fn__7680.invoke(closure.clj:2751) at cljs.closure$build.invokeStatic(closure.clj:2750) at cljs.closure$build.invoke(closure.clj:2663) at cljs.build.api$build.invokeStatic(api.clj:205) at cljs.build.api$build.invoke(api.clj:189) at cljs.cli$default_compile.invokeStatic(cli.clj:391) at cljs.cli$default_compile.invoke(cli.clj:361) at cljs.cli$compile_opt.invokeStatic(cli.clj:398) at cljs.cli$compile_opt.invoke(cli.clj:396) at cljs.cli$main.invokeStatic(cli.clj:527) at cljs.cli$main.doInvoke(cli.clj:516) at clojure.lang.RestFn.applyTo(RestFn.java:139) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$apply.invoke(core.clj:652) at cljs.main$_main.invokeStatic(main.clj:60) at cljs.main$_main.doInvoke(main.clj:52) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.lang.Var.applyTo(Var.java:702) at clojure.core$apply.invokeStatic(core.clj:657) at clojure.main$main_opt.invokeStatic(main.clj:317) at clojure.main$main_opt.invoke(main.clj:313) at clojure.main$main.invokeStatic(main.clj:424) at clojure.main$main.doInvoke(main.clj:387) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.lang.Var.applyTo(Var.java:702) at clojure.main.main(main.java:37)

Environment

None

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major