Skip to content
David Copeland edited this page Jul 3, 2013 · 49 revisions

All future release notes are in the releases section

v.2.6.0 - Jun 22, 2013

  • --version now just shows the version, courtesy @brianknight10 (see 138,143)
  • Synopsis is now more honest - doesn't show [command options] if there aren't any, courtesy @calestar (see 147)
  • A falsey exit from pre will now cause the app to exit nonzero (or with an exception if GLI_DEBUG is set), (see 146)
  • Support for terminal detection on solaris (see 129)

Biggest change is:

Redesign of how subcommands are handled to enable each subcommand to have its own space of arguments and options.

To enable this, you must subcommand_option_handling :normal

subcommand_option_handling :normal

This is inserted into new applications, but isn't the default for backwards compatibility.


Subcommands can't use flags or switches the parent uses:

command :tasks do |c|
  c.flag :long
  c.command :list do |list|
    c.flag :long # <---- runtime error
    c.action do |*|

Subcommands can't use a flag/switch with the same name as another subcommand with the same parent:

command :tasks do |c|
  c.command :list do |list|
    c.flag :long
    c.action do |*|

  c.command :new do |new|
    c.flag :long # <----- runtime error
    c.action do |*|


Each subcommand has its own "flagspace":

command :tasks do |c|
  c.flag :long
  c.command :list do |list|
    c.flag :long
    c.action do |*|

  c.command :new do |new|
    c.flag :long # <----- runtime error
    c.action do |*|

You might do this:

> my_app tasks --long given-to-command list --long given-to-list-subcommand
> my_app tasks --long given-to-command new --long given-to-list-subcommand

The reason for an RC is that it required a fair amount of re-working of the code, so I want to be sure nothings subtle was broken.

Old behavior is the default:

v2.5.6 - Mar 31, 2013

  • Re-fix issue where sub-sub commands were not getting documented properly (see 131 again)
  • Make dirs up to config dir if needed (see 139, thanks @aussielunix!)

v2.5.5 - Jan 22, 2013

  • Fix issue where default command with no description caused a crash (see 131)

v2.5.4 - Jan 22, 2013

  • Add back the "skips" overrides for the help command (see 124)

v2.5.3 - Dec 26, 2012

  • Fix hard-coded todo in scaffold (see 118, thanks to @pengwynn)
  • Require pathname explicitly (see 112)
  • Doc typos (see 120, thanks again to @pengwynn!)

v2.5.2 - Dec 9, 2012

  • Apps can have dashes in their names now, (see 117 and thanks to @kale!)

v2.5.1 - Dec 8, 2012

  • Options are ordered based on help command order (e.g. manual vs. alphabetic) as opposed to being always alpha, working on 1.8 Rubies (The fix for 114 was insufficient)

v2.5.0 - Nov 21, 2012

  • Switches can now be defaulted to "on" (see 86)
  • Options are ordered based on help command order (e.g. manual vs. alphabetic) as opposed to being always alpha (see 114)

v2.4.1 - Oct 20, 2012

  • Bugfix for help output when using an unknown command. Help advised you to use gli and not the actual app name to get help. (see 111)

v2.4.0 - Oct 11, 2012

  • Expand commands_from to allow for requiring files from an absolute path outside the load path, so as to allow for runtime plugins, courtesy @pengwynn (see 109)

v2.3.0 - Oct 2, 2012

  • Bugfix in scaffold, courtesy @pengwynn, (see 108)
  • Options now available as strings and symbols from options and global_options hashes passed to action blocks (see 106)
  • Proper verbatim help output that I botched initially. Now, :verbatim does no wrapping of any kind. Courtesy, @d1 (see 107)

v2.2.1 - Sept 19, 2012

  • Fix bug in _doc command on 1.8 rubies

v2.2.0 - Sept 19, 2012

  • Improve format of rdoc from the _doc command
  • App can get a long_desc (see 101)
  • -h for a command or subcommand shows help for that command or subcommand (see 104)
  • Allow flag default values to be masked, e.g. for passwords in a config file (see 71)
  • Allow manual ordering of help commands, instead of sorting (see 83)
  • Better control of help text wrapping; can disable or enable only for TTY (see 100)

v2.1.0 - Sept 13, 2012

  • Can document command arguments as optional and/or multiple (see 85)
  • Restore -c to the help command and make it work with sub commands for shell completion assistance (see 105)
  • Option to leave ARGV unmodified (see 103)

v2.0.0 - August 14, 2012

  • Subcommands
  • Better help output
  • Way more features when declaring flags and switches
  • OptionParser underneath, so you get all of it's power (and none of it's weaknesses)
  • Switches are negatable by default
  • Bootstraped apps are better, including aruba, an rvmrc, and more modern filenames
  • More easily place command declarations in external files
  • Enhanced rdoc
  • Make include GLI backwards-compatible (but fail with a useful message)
  • Fixed bug where default_command didn't work for top level commands. Fix courtesy @v-yarotsky
  • Added around hook for automatic-resource-management of global setup. Idea courtesy @v-yarotsky
  • Doc fixes from @v-yarotsky and @aterris
  • Various bug fixes

v1.6.0 - April 9, 2012

  • Can add multi-paragraph descriptions via a double line break
  • New command, default_command
  • Bugfixes related to scaffolded apps

v1.3.7 - November 21, 2011

  • File permissions on created config files set more strictly, (see #58), thanks @bemurphy!)

v1.3.6 - November 14, 2011

  • Fixes #57 by removing the -R from the rdoc call in the gemspec

v1.3.5 - October 26, 2011

  • Added back the load path stuff I removed in 1.3.4, since it was causing problems running locally. Need a better solution and/or wait for GLI 2

v1.3.4 - October 9, 2011

  • 1.9.3 support
  • Stop futzing with the load path in gli and in generated code

v1.3.2 - Sep 3, 2011

  • Fix bug with word-wrapping help text ( See #51, thanks babysnakes!)
  • Fix bug where omitting all desc calls results in no documentation (closed #48)
  • Get the home directory in a more x-platform way (closed #47)
  • Added simplecov for 1.9.2 code coverage
  • Some other fixes to make dev tools compatible with various rubies

v1.3.1 - Jun 26 2011

Thanks to gnufied for the patches!

  • Use /usr/bin/env instead of /usr/bin/ruby in gli and scaffolded apps
  • Allow flags to appear after arguments
  • Gemfile.lock no longer tracked in git, per best practices

v1.3.0 - May 1 2011

  • Help now shows the default values based on what's in the configuration (closed #10)
  • Fixed bug where options specified in config cannot be overridden on the command line (closed #43)
  • Scaffolded apps no longer require a 1.8.7-only test class (closed #42)
  • You can now skip pre and post blocks per command (see Hooks for more)
  • You can specify a program description and it shows up in the help (closed #40)
  • JRuby support (i.e. just made sure it actually works on JRuby)
  • Test coverage of the gli command and a basic scaffolded site (closed #30)

v1.2.6 - Mar 6 2011

  • Help output now makes distinction between global and command options
  • Error messages on bad invocations now give you a clue as to where to look (e.g. use 'gli help' for list of commands)
  • Using gemspec and add_development_dependency instead of putting gems in the Gemfile
  • Massive overhaul of rubydoc; everything's consistent, up to date, and usable now
  • Created the all-important cheatsheet
  • Refactored some nasty methods

v1.2.5 - Dec 12 2010

  • Corrected gemspec to include all the files
  • Fixed issue with Ruby 1.9 case statement

v1.2.4 - Dec 12 2010

This version is broken, as it doesn't include ONE file in the .gem

v1.2.3 - Dec 12 2010

This version is broken, as it doesn't include two files in the .gem, and is not compatible with Ruby 1.9

  • new GLI apps will exit nonzero on errors (see Error Handling)
  • Support for custom exit codes
  • GLI now uses an environment variable to allow for debugging caught exceptions
  • GLI now uses the width of the terminal for displaying help messages, not just hard-coding 80

v1.2.2 - Dec 11 2010

  • Changed uses of map(&:symbol) to older form, since this doesn't work on 100% of Ruby 1.8.7s.

v1.2.1 - Nov 26 2010

  • Changed default data structure of options back to a Hash. If you want to use the OpenStruct subclass Options, simply put use_openstruct true in your command line definition.

v1.2.0 - Nov 26 2010

  • Added ability to use help command to list commands suitable for creating bash completion script
  • options and global_options will now contain values for all aliases of each flag and switch, so if you created a flag with flag [:f,:flag] and the user specifies -f foo on the command line, both options[:f] and options[:flag] will have the value foo. Same behavior for --flag=foo.
  • You may now no-longer use names that have already been used. So if you declare a switch switch :foo and then later declare a flag flag [:f,:foo], you get an ArgumentError. This is only checked within relevant scope, so you can still use the same option names between commands, and you can still have the same option name once in global and once in command scope. This is really a bugfix as the behavior of GLI was not clear before.
  • long_desc now shows up in generated rdoc for flags and switches
  • Scaffoling now generates a usable Gemfile for bundler
  • More direct support for version numbers in GLI-managed apps

v1.1.3 - Oct 24 2010

Changed the way we locate FILE's directory; if it's a symlink it would've have worked. Required adding :realpath method to File for pre 1.9.2 rubies