Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] CommandLine-0.7.9 Update

Reply
Thread Tools

[ANN] CommandLine-0.7.9 Update

 
 
Jim Freeze
Guest
Posts: n/a
 
      11-06-2005
CommandLine-0.7.9
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
Author: Jim Freeze

WHAT
=3D=3D=3D=3D
Library update to CommandLine.
- New documentation.
- Refined API - May be some API changes required from 0.7.6.
- Gem name is now lowercase

DOCS
=3D=3D=3D=3D
=09http://rubyforge.org/docman/view.php/632/232/posted-docs.index.html

ABOUT
=3D=3D=3D=3D=3D
CommandLine is a library that greatly simplifies the repetitive
process of building a command line user interface for your
applications. It's 'ruby-like' usage style streamlines application
development so that even applications with numerous configuration
options can be quickly put together. CommandLine automatically builds
friendly usage and help screens that are nicely formatted for the
user. No longer is starting an application a pain where you have to
copy boiler plate code (or a previous application) and retype
repetitive code to get an application started

EXAMPLE
=3D=3D=3D=3D=3D=3D=3D

% cat app.rb
#---------------------------------------------------
#!/usr/bin/env ruby

require 'rubygems'
require 'commandline'

class App < CommandLine::Application

def initialize
version "0.0.1"
author "Author Name"
copyright "Copyright (c) 2005, Jim Freeze"
short_description "A simple app example that takes two arguments."
long_description "This app is a simple application example that "+
"supports three options and two commandline "+
"arguments."

option :debug, :arity =3D> [0,1],
=09=09=09=09 :arg_description =3D> "debug_level",
pt_description =3D> "Set debug level from 0 to 9.",
=09=09=09=09 pt_found =3D> get_args
option :version, :help

expected_ aram_file, ut_file
end

def main
=09=09#... code here
end
end#class App
#---------------------------------------------------

% app.rb -h
NAME

app.rb - A simple app example that takes two arguments.

DESCRIPTION

This app is a simple application example that supports three
options and two commandline arguments.

OPTIONS

--debug,-d debug_level
Set debug level from 0 to 9.

--version,-v
Displays application version.

--help,-h
Displays help page.

AUTHOR: Author Name
Copyright (c) 2005, Jim Freeze

TESTS
=3D=3D=3D=3D=3D
Tests: 81
Assertions: 310


DOWNLOAD & INSTALLATION
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D

Homepage: http://rubyforge.org/projects/optionparser/
Documentation: http://rubyforge.org/docman/view.php...sted-docs.ind=
ex.html
Download: http://rubyforge.org/frs/?group_id=3...ease_id=3D2345

Dependencies:
* None

Currently CommandLine is only available as a rubygem.

Via RubyGems
$ gem install -r commandline

All feedback is appreciated!

Installations not yet available
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
# not in RPA yet
Via RPA
$ rpa install commandline

# this either
The do-it-yourself way
$ ruby setup.rb config
$ ruby setup.rb setup
$ ruby setup.rb install

# nor this
The simplified do-it-yourself way
$ rake install


RELEASE NOTES
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D 0.7.9 11/05/2005
=3D=3D=3D Additions
- Renamed gem to lowercase commandline
- Added replay command options
- Added CommandLine::Application_wo_AutoRun - no auto run set thru at_exit
- Added documentation for CommandLine::Application - instead of just README
- Changed :arg_arity to :arity in Option
- Add :required for use with pt_found
- Added args accessor for @args - suggested by Esteban Manchado Vel=E1zquez
- Added opt() accessor for @option_data[]


HISTORY
=3D=3D=3D=3D=3D=3D=3D
After poking around in a few corporations, it was evident that
option parsing was not well understood. Therefore, many inhouse
tools were built that did not conform to any of the POSIX, Gnu or XTools
option styles. CommandLine::OptionParser was developed so that
new applications could be written that conformed to accepted standards,
but non-standard option configurations could be handled as well
to support legacy interfaces.

Once the option parsing was written, there was a need to streamline
the repetitive tasks in setting up an application. The original
boilerplate was simple, but after taking a few cues from
rails, a significant amount of functionality was added to
Application that make it a very useful tool yet simple to use.

More information and usage scenarios on OptionParser can be found at:
http://rubyforge.org/projects/optionparser/


ACKNOWLEDGEMENTS
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
This library contains code from:
* Austin Ziegler - Text::Format
* Ara - open4.rb - obtained from codeforthepeople
--

--
Jim Freeze


 
Reply With Quote
 
 
 
 
Duane Johnson
Guest
Posts: n/a
 
      11-10-2005
Thanks, Jim! I'll tuck this away in a tool belt. Great work!

Duane Johnson
(canadaduane)

On Nov 5, 2005, at 9:35 PM, Jim Freeze wrote:

> CommandLine-0.7.9
> =================
> Author: Jim Freeze
>
> WHAT
> ====
> Library update to CommandLine.
> - New documentation.
> - Refined API - May be some API changes required from 0.7.6.
> - Gem name is now lowercase




 
Reply With Quote
 
 
 
 
Jim Freeze
Guest
Posts: n/a
 
      11-10-2005
On 11/10/05, Duane Johnson <(E-Mail Removed)> wrote:
> Thanks, Jim! I'll tuck this away in a tool belt. Great work!


Sure. Send feedback anytime.

Enjoy!



--
Jim Freeze


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update On The Windows Phone 7 Update Update Lawrence D'Oliveiro NZ Computing 2 02-25-2011 08:03 AM
[BUG?] (2) Update database using stored procedure and OleDbDataAdapter.Update joun ASP .Net 5 11-30-2004 06:51 PM
[BUG?] Update database using stored procedure and OleDbDataAdapter.Update joun ASP .Net 9 11-30-2004 04:57 AM
[Vb.net question] how to apply online update function into program (the effect just like Norton system work live update) chan ASP .Net 1 03-04-2004 02:58 PM
Datalist: update a datasource without using select/edit/update Hartmut Schroth ASP .Net 3 12-01-2003 09:54 AM



Advertisments