Just an FYI. As part of the 1.3.0 release, the contrib libraries are getting a facelift:
http://dev.clojure.org/display/design/Contrib+Library+Names clojure.contrib.command-line will become clojure.tools.cli - I'm not sure who the new maintainer is but they would be the person best placed to address your suggestion since the old contrib libraries will not be updated. I haven't used the command-line library so I can't really comment but, on the surface, the ability to print help from multiple places sounds useful. Sean On Thu, Apr 28, 2011 at 12:38 PM, knuthie <knuther...@googlemail.com> wrote: > I am relatively new to clojure and while using the contrib.command- > line, I found there is a place for a small improvement, at least for > my usecase :-) > > I use the with-command-line macro and then check eg. that the > remaining parameters, that are not caught amount to the right number > (eg. I want to have a commandline, where there are options and at most > two additional arguments). In case the check fails, it would be > beautiful to print the help message that gets printed, when -h or -- > help is provided. Currently I cannot call the "print-help" function > because I do not have access to the necessary parameters. > > If the with-command-line macro would be slightly changed to add a > binding to a "print-usage" function: > like > (let [~(symbol "print-usage") #(print-help ~desc cmdmap#) ] > > then it be possible to do something like this: > > (with-command-line ["-s" "1" "2"] "Usage: testfile [Options] > <configuration file> <outputfile>" > [[synonyms? s? "Use Synonyms"][normalizer? n? "Use Normalizer"] > files] > (if (= 2 (count files)) > (println (files 0)) > ;;else > (print-usage))) > > Is that a good idea? -- 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 Note that posts from new members are moderated - please be patient with your first post. 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