Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A command line option parser.
tree: 51a4284b72

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.textile

README.textile

Power

A command line parser.

Because, lets face it, they all kinda suck some which way or another.

Not that this will be an improvement, just my shot in the dark.

Examples

Or what we’ll call examples but is actually ideas for what Power might do…

If Power were for packaging binary runners…

<pre> module FooBar class Runner def start(port = 8000, interval = 0.01) aliases :port => :p, :interval => :I

  1. magic
    end
    end
    end

Which could be run with:

<pre> $ foobar start -p 4890 -I 0.08 </pre>

Then, the binary foobar would be defined something like this
(possibly):

<pre> require 'foo_bar' FooBar::Runner.send(:include, Power) FooBar::Runner.run!(ARGV) </pre>

We’d need to use Ruby2Ruby or ParseRuby to figure out the params, plus there
are certain option classes this doesn’t allow for: options without default
values (and those that do have specific types), options that are not
param-based (ie: the name of the app to generate in rails foo),
etc.

This is all just a random idea…

The Name

The name could change. Just had to name it something, you know.

License

Copyright © 2008 Matt Todd.

Licensed under the MIT license.

TODO: copy license text here or in LICENSE file.

Something went wrong with that request. Please try again.