#1 Add additional help formatters #53

Merged
merged 1 commit into from Feb 22, 2013

2 participants

@hpaulj

lib/help/added_formatters.js - HelpFormatter subclasses to

  • include defaults in the argument help lines
  • display descriptions in raw form (without reformatting)
  • display all text in raw form

The ArgumentDefaultsHelpFormatter is probably the most useful.

lib/argparse.js - exports these new classes.

test/formatter.js - mocha tests, taken from test_argparse.py
tests clips from the parser.formatHelp() text.
It includes a test for array metavars.

examples/testformatters.js - same examples, but displays the help text.

formatter.js - _fillText, change forEach to map to correctly indent.
mainly affects group descriptions.

@hpaulj hpaulj Add additional help formatters
lib/help/added_formatters.js - HelpFormatter subclasses to
- include defaults in the argument help lines
- display descriptions in raw form (without reformatting)
- display all text in raw form

The ArgumentDefaultsHelpFormatter is probably the most useful.

lib/argparse.js - exports these new classes.

test/formatter.js - mocha tests, taken from test_argparse.py
    tests clips from the parser.formatHelp() text.
    It includes a test for array metavars.

examples/testformatters.js - same examples, but displays the help text.

formatter.js - _fillText, change forEach to map to correctly indent.
    mainly affects group descriptions.
d69956f
@puzrin
Nodeca member

Travis failed (lint), please fix. Now all pull requests are automatically checked by travis

@puzrin
Nodeca member

Ah, that's not your fault. New jshint better search errors, and found those in other files. Will fix them myself.

@puzrin puzrin merged commit c19fa13 into nodeca:master Feb 22, 2013

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment