Permalink
Browse files

Adjust option/command def width in --help

  • Loading branch information...
1 parent c1f7c92 commit 92b687f827e979392fa530a0eabcad994c83f0d0 @chriso chriso committed May 24, 2011
Showing with 6 additions and 2 deletions.
  1. +2 −1 cli.js
  2. +4 −1 examples/long_desc.js
View
3 cli.js
@@ -40,6 +40,7 @@ cli.args = [];
cli.command;
cli.width = 70;
+cli.option_width = 25;
/**
* Bind kof's node-natives (https://github.com/kof/node-natives) to `cli.native`
@@ -564,7 +565,7 @@ var pad = function (str, len) {
*/
cli.getUsage = function () {
var short, desc, optional, line, seen_opts = [],
- switch_pad = 25;
+ switch_pad = cli.option_width;
var trunc_desc = function (pref, desc, len) {
var pref_len = pref.length,
View
5 examples/long_desc.js
@@ -2,9 +2,12 @@
var cli = require('../');
-//You can also (optionally) boost the width of output with:
+//You can (optionally) boost the width of output with:
//cli.width = 120;
+//You can also adjust the width of the options/command definitions
+//cli.option_width = 25;
+
var long_desc = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s '
+ 'standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make'
+ ' a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, '

0 comments on commit 92b687f

Please sign in to comment.