Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Multiple line in description, help details.... #54

Closed
MitchellAJ opened this Issue Jun 2, 2013 · 3 comments

Comments

Projects
None yet
2 participants

For example:

I would like to be able to show:

Line 1 of application description
Line 2 .... etc

Author:

ABC did most of the work
DEF also worked on this

Collaborator

ggilder commented Jun 2, 2013

Commander does support multiple lines in descriptions; for example, this script is pretty close to what you describe:

require 'commander/import'

program :name, 'Foo Bar'
program :version, '1.0.0'
program :description, <<DESC
Author:
ABC did most of the work
DEF also worked on this
DESC

However, the help formatter currently doesn't do anything to preserve indentation for multiline strings, so the indentation is not consistent between the first line and the following lines.

If you're interested in making a patch to fix this, I would look at the help formatter ERB files: https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal/help.erb#L7
https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal/command_help.erb#L15

And maybe implement an indentation helper in https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal.rb or https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/base.rb

Thanks for the rapid reply, I’ll have a look and submit something.

Allen.

From: Gabriel Gilder [mailto:notifications@github.com]
Sent: June-02-13 3:06 PM
To: visionmedia/commander
Cc: Allen Mitchell
Subject: Re: [commander] Multiple line in description, help details.... (#54)

Commander does support multiple lines in descriptions; for example, this script is pretty close to what you describe:

require 'commander/import'

program :name, 'Foo Bar'
program :version, '1.0.0'
program :description, <<DESC
Author:
ABC did most of the work
DEF also worked on this
DESC

However, the help formatter currently doesn't do anything to preserve indentation for multiline strings, so the indentation is not consistent between the first line and the following lines.

If you're interested in making a patch to fix this, I would look at the help formatter ERB files: https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal/help.erb#L7
https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal/command_help.erb#L15

And maybe implement an indentation helper in https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/terminal.rb or https://github.com/visionmedia/commander/blob/master/lib/commander/help_formatters/base.rb


Reply to this email directly or view it on GitHub visionmedia#54 (comment) . https://github.com/notifications/beacon/e-O88Xs4RTqNMWG2z6uql_mCjMoEak12wqS-jxTra8TI8GX8j8m0lpbYFNu_rSRJ.gif

No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 2013.0.3343 / Virus Database: 3184/6376 - Release Date: 06/02/13

@ggilder ggilder closed this in 9ea5c0f Jul 21, 2013

Collaborator

ggilder commented Jul 21, 2013

Fixed here: 9ea5c0f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment