在命令行中运行以下命令
clj -Acider -m "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-middleware]"
给定
:cider {:extra-deps {nrepl {:mvn/version "0.6.0"}
refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"}
cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}}
可以运行。但不能将它移动到 :main-opts
:cider {:extra-deps {nrepl {:mvn/version "0.6.0"}
refactor-nrepl {:mvn/version "2.5.0-SNAPSHOT"}
cider/cider-nrepl {:mvn/version "0.23.0-SNAPSHOT"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor cider.nrepl/cider-middleware]"]}
并运行
clj -Acider
失败,因为
Exception in thread "main" java.lang.RuntimeException: EOF while reading [5/723]
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.EdnReader.readDelimitedList(EdnReader.java:746)
at clojure.lang.EdnReader$VectorReader.invoke(EdnReader.java:672)
at clojure.lang.EdnReader.read(EdnReader.java:145)
at clojure.lang.EdnReader.read(EdnReader.java:111)
at clojure.lang.EdnReader.readString(EdnReader.java:67)
at clojure.edn$read_string.invokeStatic(edn.clj:46)
at clojure.edn$read_string.invokeStatic(edn.clj:37)
at clojure.edn$read_string.invoke(edn.clj:37)
at nrepl.cmdline$parse_cli_values$fn__1275.invoke(cmdline.clj:248)
at clojure.core$fn__8072$fn__8074.invoke(core.clj:6760)
at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
at clojure.core.protocols$fn__7839.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__7839.invoke(protocols.clj:75)
at clojure.core.protocols$fn__7781$G__7776__7794.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6748)
at clojure.core$fn__8072.invokeStatic(core.clj:6750)
at clojure.core$fn__8072.invoke(core.clj:6750)
at clojure.core.protocols$fn__7860$G__7855__7869.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6776)
at clojure.core$reduce_kv.invoke(core.clj:6767)
at nrepl.cmdline$parse_cli_values.invokeStatic(cmdline.clj:246)
at nrepl.cmdline$parse_cli_values.invoke(cmdline.clj:242)
at nrepl.cmdline$args__GT_cli_options.invokeStatic(cmdline.clj:261)
at nrepl.cmdline$args__GT_cli_options.invoke(cmdline.clj:253)
at nrepl.cmdline$_main.invokeStatic(cmdline.clj:447)
at nrepl.cmdline$_main.doInvoke(cmdline.clj:443)
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)