Re: Origin of tools.cli optional

2012-08-26 Thread octopusgrabbus
Thanks for your answer. I will adapt the small number of programs I have to 
the newer version of the library. Rather than criticize your efforts in a 
language in which I am still very much a student, I will just say I miss 
the required optional syntax. Other than that, your library is extremely 
helpful, whether I have to back-adapt or not.

Thanks again. 

On Friday, August 24, 2012 7:41:56 PM UTC-4, Gaz wrote:

 The library was originally based on Clargon (a library I wrote) which 
 had the interface you are describing (optional and required 
 functions). Various changes were made after getting feedback on the 
 clojure-dev mailing list, which you can read about here if you're 
 interested: 

 https://groups.google.com/d/topic/clojure-dev/KGvzndhX5vk/discussion 

 Hopefully the project documentation is clear about its use: 

 https://github.com/clojure/tools.cli 

 Hope that helps, 

 Gaz 

 On Fri, Aug 24, 2012 at 2:52 PM, octopusgrabbus 
 octopus...@gmail.com javascript: wrote: 
  Given the following code 
  
  (defn parse-opts 
Using the newer cli library, parses command line args. 
[args] 
(cli args 
 (optional [--in-file-name .csv input file :default 
  resultset.csv] identity) 
 (optional [--out-file-name .csv pipe delimited output file 
  :default accumail_out.unl] ))) 
  
  What is the origin of optional, and why do tools.cli examples that I can 
  find now leave out (optional ... ? 
  
  Would current examples still use identity? 
  
  Here is why I'm asking: 
  
  
 http://stackoverflow.com/questions/12112403/how-do-i-mix-non-optional-cli-arguments-with-optional-ones
  
  
  Thanks for any pointers or help. 
  
  -- 
  You received this message because you are subscribed to the Google 
  Groups Clojure group. 
  To post to this group, send email to clo...@googlegroups.comjavascript: 
  Note that posts from new members are moderated - please be patient with 
 your 
  first post. 
  To unsubscribe from this group, send email to 
  clojure+u...@googlegroups.com javascript: 
  For more options, visit this group at 
  http://groups.google.com/group/clojure?hl=en 


-- 
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

Origin of tools.cli optional

2012-08-24 Thread octopusgrabbus
Given the following code

(defn parse-opts
  Using the newer cli library, parses command line args.
  [args]
  (cli args
   (optional [--in-file-name .csv input file :default 
resultset.csv] identity)
   (optional [--out-file-name .csv pipe delimited output file 
:default accumail_out.unl] )))

What is the origin of optional, and why do tools.cli examples that I can 
find now leave out (optional ... ?

Would current examples still use identity?

Here is why I'm asking:

http://stackoverflow.com/questions/12112403/how-do-i-mix-non-optional-cli-arguments-with-optional-ones

Thanks for any pointers or help.

-- 
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

Re: Origin of tools.cli optional

2012-08-24 Thread gaz jones
The library was originally based on Clargon (a library I wrote) which
had the interface you are describing (optional and required
functions). Various changes were made after getting feedback on the
clojure-dev mailing list, which you can read about here if you're
interested:

https://groups.google.com/d/topic/clojure-dev/KGvzndhX5vk/discussion

Hopefully the project documentation is clear about its use:

https://github.com/clojure/tools.cli

Hope that helps,

Gaz

On Fri, Aug 24, 2012 at 2:52 PM, octopusgrabbus
octopusgrab...@gmail.com wrote:
 Given the following code

 (defn parse-opts
   Using the newer cli library, parses command line args.
   [args]
   (cli args
(optional [--in-file-name .csv input file :default
 resultset.csv] identity)
(optional [--out-file-name .csv pipe delimited output file
 :default accumail_out.unl] )))

 What is the origin of optional, and why do tools.cli examples that I can
 find now leave out (optional ... ?

 Would current examples still use identity?

 Here is why I'm asking:

 http://stackoverflow.com/questions/12112403/how-do-i-mix-non-optional-cli-arguments-with-optional-ones

 Thanks for any pointers or help.

 --
 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

-- 
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