Release 0.7: Return of the Compliance10/19/2009
Release 0.7: Return of the Compliance Well. Optiflag came perilously close to becoming abandonware, as Optiflag 0.6.5 was not compliant with the new Ruby 1.9 release, and as I, (the maintainer), forgot to checkup on the baby that I had released into the world wide web some 3 1/2 years ago.

Anyways, go get the new 0.7 gem.

Here was the problem:

Do this in your irb in 1.8 and 1.9:
>me = [1,2,3,4,5,6,7]
>me[2..3] = nil
In 1.8 you get this
>=> [1, 2, 5, 6, 7]
In 1.9 you get this
>=> [1, 2, nil, 5, 6, 7]
Compacting was needed. Thanks to Adam Salter (aqsalter) for discovering this and pointing out where in my code I had to put the compact call (also for getting on my case). Luckily, in a smarter age, I had written some 300 testcases. I found a few other quirky 1.9 non-compliance items and was able to get the code base to pass all the cases in both 1.8 and 1.9. Nevertheless, keep me updated.

I had been away from Ruby for the past two years. Apologies to those inconvenienced by my lack of update. Hopefully I'll stay on top of any new non-compliance issues. As to new features? Nah. Probably not. I think in my discussion page I came to terms with accepting that Optiflag is not out here to rule the command-line processing world. Use it for your internal scripts -- it's easy. But if you need sub-commands and POSIX compliance, go find something else. Consider Optiflag the VB of the Ruby CL libraries.

Release 0.6.5 (Super Massive Refactoring)4/1/07
Release 0.6.5 (Super Massive Refactoring) Huge changes, including this website. There are now rdocs. See the release notes for complete details.
Interesting new feature: Use of Plain Old Ruby Object as template for flags. See this example.
Someone actually uses OptiFlag!!9/27/06
Someone actually uses OptiFlag!! Not that it should come as a surprise,(otherwise I wouldn't have spent so much time creating it and maintaining it).

With no advertisement at all, OptiFlag has found its way into the toolbox of someone else's open-source effort. (I guess they must have googled for it). Anyways...

Outcry, a remotely controllable streamer for icecast, seems to be the first web viewable project to use OptiFlag to handle its command-line processing. Thanks outcry.
Release 0.6 (Character Flags FINALLY)8/28/06
Release 0.6 (Character Flags FINALLY)
  • added top-level flag declaration 'character_flag'
  • made 'keyword' an optional by default
Thanks to Takashi Kawachi for producing a gemspec for optiflag.
RELEASE 0.5 (Features getting close to done)8/19/06
RELEASE 0.5 (Features getting close to done)
  • added top-level flag declaration 'keyword'
  • added unit test for this new functionality
  • added automatically generated ?methods? for alternate forms of flags
  • made sure not to try generating methods from non alphabetic flag names
  • Added ability to acces values via hash lookup
RELEASE 0.4 (Internal Maintenance Mainly)7/12/06
RELEASE 0.4 (Internal Maintenance Mainly)
  • Added internal version number
  • Addded experimental ability to define flags off of the fields of a pre-existing object. Some problems with visibility will keep this experimental for now. See the method using_object
  • Spelling fix ups
  • Aliased flag_properties to properties. For ease of use.
  • Added some large section-defining comments
  • Renamed internal EachFlag variables from 'foo_val' to 'the_foo'
  • Coined terminology for Application Programmer's Syntax
    • Top-Level Flag Declarers
    • Clause-Level Flag Modifier
RELEASE 0.3 5/31/06
  • Fixed a bug that globally changed the state of all modules when a user chose to use the 'module SomeThing extend OptiFlag::Flagset(:flag_symbol => "/")' syntax. Required some singleton class trickeration and module cloning.
  • Changed all references from OptiFlag::FlagestDefinitions to OptiFlag::Flagset which is shorter and therefore easier to use (not everyone has dynamic-abbrev in emacs enabled to make typing easy)
  • Started changing the design of printing help so that users can register help-formatting bundles to do their own rendering of usage and error messages
  • Changed the functionality of the 'usage_flag' option to be of either zero or one arity. With standard zero arity, the help will print out the standard help/usage message. With an arity of one, the help/usage flag will assume that the argument is another flag for which we will print extended usage (example: '-h dir' will print the help message just for the '-dir' flag)
  • Fixed another nasty global-state bug (the perils of using '@' syntax with modules)... This one wasn't needed -- it would only affect those people who chose to parse an array of strings a 2nd and 3rd time, and I was considering mandating that the parse method could only be called once... but since my tests relied on multiple parses, I decided to fix it just to make the test suites continually easy to write.
  • Added a new top-level declarative form: 'optional_switch_flag' which is an optional flag with zero arity. (I needed this one for myself)
  • A few more tests were added:
    • tc_basic_optional_flag.rb
    • tc_bug_two.rb
  • Wrote some XSLT and a ruby-script to autogenerate the site at
  • Added a warning generation system for things that are not errors
    • extra parameters left over (implemented)
    • potential consumption of an optional flag as value to a flag with >0 arity. (example: '-dir -verbose' where '-dir' takes on argument and '-verbose' is optional. In this case the '-verbose' would be consumed as the value unless warning mode was on)
RELEASE 0.2 (5/23/2006)5/23/06
RELEASE 0.2 (5/23/2006)
  • The following features are implemented:
  • required and optional flags
  • ability to change flag arity from 0 to N
  • flag value validation
    • by set membership
    • by regular expression
  • flag value translation (pre and post validation)
  • auto help
  • auto error checking
  • usage and extended usage flags
  • universal flag symbol change
  • case by case flag symbol change (both normal and long form)
  • alternate forms for normal flag
  • alternate form for long form flag
  • auto-generated property-type methods added to ARGV for flag values post-parsing
  • sub-clause verbs
    • 'description'
    • 'arity'
    • 'no_args'
    • 'one_arg'
    • 'two_args'
    • 'long_form'
    • 'translate'
    • 'value_matches'
    • 'value_in_set'
    • 'required'
    • 'optional'
    • 'alternate_forms'
    • 'long_form'
    • 'dash_symbol'
    • 'long_dash_symbol'
  • Added a series of Example Files
RELEASE 0.1 5/22/06
RELEASE 0.1 First ever release of OptiFlag