> I suspect that *command-line-arguments* would have "myapp.clj" as the
> 0th element in the
> clj myapp.clj
> Can't test right now though sorry.

I tested this and it does work for me. If it does not work for you is
most likely in your clj script or bat file. I noticed on the wiki the
incorrect advice was given:
    java  -cp %CLOJURE_JAR%;%CONTRIB_JAR% clojure.lang.Script %1

I've updated the wiki with the correct usage:
    java  -cp %CLOJURE_JAR%;%CONTRIB_JAR% clojure.lang.Script %1 -- %*

Check your script for the -- between script name and arglist. Note
that %* includes %1.

script-test.clj:
(if *command-line-args*
  (println "SCRIPT")
  (println "REPL"))


C:\java>clj script-test.clj
SCRIPT

C:\java>clj
Clojure
user=> (load-file "script-test.clj")
REPL
nil


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to