Using with-command-line from clojure.contrib.command-line, if the list
of command-line args is empty or nil, the usage message is printed
(and the nested code is not run), even if all the options have default
values.

The following (note that the first arg is the empty list) prints the
usage message, and does not print "Hello, world!":


(use 'clojure.contrib.command-line)
(with-command-line `()
  "cli-test [options] [commands]"
  [[option1 "Some command-line option" 12345]
   commands]
  (println "Hello, world!"))


However, it does print "Hello, world!" if you put something in the
args list.


(Clojure is awesome, btw.)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to