[MacPorts] #23366: Clojure "clj" scripts mess up command line arguments

MacPorts noreply at macports.org
Wed Jan 20 13:33:18 PST 2010


#23366: Clojure "clj" scripts mess up command line arguments
--------------------------------+-------------------------------------------
 Reporter:  jsg8pitt@…          |       Owner:  macports-tickets@…                   
     Type:  defect              |      Status:  new                                  
 Priority:  Normal              |   Milestone:                                       
Component:  ports               |     Version:  1.8.2                                
 Keywords:  clojure clj         |        Port:  clojure                              
--------------------------------+-------------------------------------------
 `clj myscript.clj foo bar baz` should have *command-line-args* internally
 bound to ("foo" "bar" "baz").  However, because of the implementation of
 the clj wrapper scripts, it ends up being bound to ("myscript.clj" "--"
 "foo" "bar" "baz").

 This happens because $* is being used to execute the actual clojure
 command.  However, that repeats the name of the script which was used.
 Preceding the invocation of clojure with a call to shift will yank the
 script name out of the arguments.

 I can't tell what the purpose of "--" is, and it sort of strikes me that
 if I need that argument, then I should pass it myself, but I don't really
 know.

 Patch attached.

-- 
Ticket URL: <http://trac.macports.org/ticket/23366>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list