# CoolOptions 1.0.3 has been released

**URL:** <https://www.ruby-forum.com/t/cooloptions-1-0-3-has-been-released/78882>\
**Category:** Ruby\
**Created:** [December 9, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/cooloptions-1-0-3-has-been-released/78882 "2006-12-09T21:28:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntalbott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b782af/32.png) [@ntalbott](https://www.ruby-forum.com/u/ntalbott)\
**Post date:** [December 9, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/cooloptions-1-0-3-has-been-released/78882/1 "2006-12-09T21:28:07Z")

</div>

CoolOptions version 1.0.3 has been released!

[http://cooloptions.rubyforge.org/](http://cooloptions.rubyforge.org/)

CoolOptions is a simple wrapper around optparse that provides less  
configuration and more convenience for doing command-line option  
handling.

As a huge fan of optparse due to its flexibility, self-documenting  
nature, and ease of use, I nevertheless found myself doing almost the  
exact same thing with it over and over again, and decided to write a  
thin wrapper around it to handle the common cases. Thus CoolOptions  
was born. An example of using it:

$ cat new\_rails\_project  
require ‘cooloptions’

options = CoolOptions.parse!(“[options] PROJECTNAME”) do |o|  
o.on “repository URL”, “Remote subversion repository.”  
o.on “svk”, “Use svk.”,  
true  
o.on “project-path PATH”, “Root of project workspaces.”,  
File.expand\_path(“~/svk”)  
o.on “l)repository-path PATH”, “Remote repository path.”,  
“/”  
o.on “mirror-path SVKPATH”, “SVK mirror path.”,  
“//”  
o.on “local-pa(t)h SVKPATH”, “SVK local path.”,  
“//local”  
o.on “create-structure”, “Create trunk/tags/branches  
structure.”, true  
o.on “finish”, “Prep and commit the new project.”,  
true

```
o.after do |r|
  r.project_path = File.expand_path(r.project_path)
  o.error("Invalid path.") unless File.exist?(r.project_path)
  r.project_name = ARGV.shift
  o.error("Project name is required.") unless r.project_name
  o.error("Project name is too funky.") unless /^\w+$/ =~ 

```

r.project\_name  
end  
end

p options.svk  
p options.project\_path  
p options.repository  
p options.create\_structure  
p options.project\_name

$ ./new\_rails\_project --no-svk -r  
[http://terralien.com/svn/terralien/](http://terralien.com/svn/terralien/) myproject  
false  
“/Users/ntalbott/svk”  
“[http://terralien.com/svn/terralien/](http://terralien.com/svn/terralien/)”  
true  
“myproject”

More details can be found in the documentation, available at the URL  
above.

Feedback is welcome, and I hope you find CoolOptions useful and  
enjoyable to use!
