add proper spacing to optparse by default

This commit is contained in:
Jeremy Ashkenas 2010-03-04 22:59:03 -05:00
parent 44398d044f
commit 965034e16e
4 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@
};
// The "--help" usage message.
usage = function usage() {
puts('\n' + option_parser.help() + '\n');
puts(option_parser.help());
return process.exit(0);
};
// The "--version" message.

View File

@ -61,7 +61,7 @@
let_part = rule.letter ? rule.letter + ', ' : ' ';
lines.push(' ' + let_part + rule.flag + spaces + rule.description);
}
return lines.join('\n');
return '\n' + lines.join('\n') + '\n';
};
return OptionParser;
}).call(this);

View File

@ -51,7 +51,7 @@ exports.run: ->
# The "--help" usage message.
usage: ->
puts '\n' + option_parser.help() + '\n'
puts option_parser.help()
process.exit 0
# The "--version" message.

View File

@ -34,7 +34,7 @@ exports.OptionParser: class OptionParser
spaces: if spaces > 0 then (' ' for i in [0..spaces]).join('') else ''
let_part: if rule.letter then rule.letter + ', ' else ' '
lines.push ' ' + let_part + rule.flag + spaces + rule.description
lines.join('\n')
'\n' + lines.join('\n') + '\n'
# Regex matchers for option flags.
LONG_FLAG: /^(--\w[\w\-]+)/