Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANN] CommandLine-0.7.9 Update

2 views
Skip to first unread message

Jim Freeze

unread,
Nov 5, 2005, 11:35:56 PM11/5/05
to
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

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

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

% 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 => [0,1],
:arg_description => "debug_level",
:opt_description => "Set debug level from 0 to 9.",
:opt_found => get_args
option :version, :help

expected_ :param_file, :out_file
end

def main
#... 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
=====
Tests: 81
Assertions: 310


DOWNLOAD & INSTALLATION
=======================

Homepage: http://rubyforge.org/projects/optionparser/
Documentation: http://rubyforge.org/docman/view.php/632/232/posted-docs.index.html
Download: http://rubyforge.org/frs/?group_id=632&release_id=2345

Dependencies:
* None

Currently CommandLine is only available as a rubygem.

Via RubyGems
$ gem install -r commandline

All feedback is appreciated!

Installations not yet available
===============================
# 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
=============

== 0.7.9 11/05/2005
=== 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 :opt_found
- Added args accessor for @args - suggested by Esteban Manchado Velázquez
- Added opt() accessor for @option_data[]


HISTORY
=======
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
================
This library contains code from:
* Austin Ziegler - Text::Format
* Ara - open4.rb - obtained from codeforthepeople
--

--
Jim Freeze


Duane Johnson

unread,
Nov 10, 2005, 5:50:53 PM11/10/05
to
Thanks, Jim! I'll tuck this away in a tool belt. Great work!

Duane Johnson
(canadaduane)

Jim Freeze

unread,
Nov 10, 2005, 5:52:37 PM11/10/05
to
On 11/10/05, Duane Johnson <duane....@gmail.com> wrote:
> Thanks, Jim! I'll tuck this away in a tool belt. Great work!

Sure. Send feedback anytime.

Enjoy! :)

--
Jim Freeze


Berger, Daniel

unread,
Nov 10, 2005, 6:01:45 PM11/10/05
to

> -----Original Message-----
> From: jimf...@gmail.com [mailto:jimf...@gmail.com] On
> Behalf Of Jim Freeze
> Sent: Thursday, November 10, 2005 3:53 PM
> To: ruby-talk ML
> Subject: Re: [ANN] CommandLine-0.7.9 Update
>
>
> On 11/10/05, Duane Johnson <duane....@gmail.com> wrote:
> > Thanks, Jim! I'll tuck this away in a tool belt. Great work!
>
> Sure. Send feedback anytime.

Is there an entry on the RAA for CommandLine? I didn't see one last
time I looked.

Thanks,

Dan


Jim Freeze

unread,
Nov 10, 2005, 6:03:22 PM11/10/05
to
On 11/10/05, Berger, Daniel <Daniel...@qwest.com> wrote:
>
> Is there an entry on the RAA for CommandLine? I didn't see one last
> time I looked.

Nope. Haven't done that. Should I?


--
Jim Freeze


Berger, Daniel

unread,
Nov 10, 2005, 6:05:58 PM11/10/05
to

> -----Original Message-----
> From: jimf...@gmail.com [mailto:jimf...@gmail.com] On
> Behalf Of Jim Freeze
> Sent: Thursday, November 10, 2005 4:03 PM
> To: ruby-talk ML
> Subject: Re: [ANN] CommandLine-0.7.9 Update
>
>

Most definitely. I do search RubyForge sometimes, but generally I rely
on the RAA to find things, as do most people I imagine.

Thanks.

Dan


James Britt

unread,
Nov 10, 2005, 7:54:52 PM11/10/05
to

I tend to forget to look in RAA. I go for RubyForge, then Google.

James


Jim Freeze

unread,
Nov 10, 2005, 9:24:58 PM11/10/05
to
On 11/10/05, Berger, Daniel <Daniel...@qwest.com> wrote:
> > Nope. Haven't done that. Should I?
>
> Most definitely. I do search RubyForge sometimes, but generally I rely
> on the RAA to find things, as do most people I imagine.

http://raa.ruby-lang.org/project/commandline/


--
Jim Freeze


0 new messages