How to use the argparse.RawTextHelpFormatter function in argparse

To help you get started, we’ve selected a few argparse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TypeStrong / atom-typescript / node_modules / tsconfig / node_modules / js-yaml / node_modules / argparse / examples / testformatters.js View on Github external
title:
      This text
    should be indented
      exactly like it is here

  --bar BAR   bar help
*/


print("TEST argparse.RawTextHelpFormatter");

parser = new argparse.ArgumentParser({
  debug: true,
  prog: 'PROG',
  formatterClass: argparse.RawTextHelpFormatter,
  description: 'Keep the formatting\n' +
               '    exactly as it is written\n' +
               '\n' +
               'here\n'
});

parser.addArgument(['--baz'], {
  help: '    baz help should also\n' +
        'appear as given here'
});

a = parser.addArgument(['--foo'], {
  help: '  foo help should also\n' +
        'appear as given here'
});
github nodeca / argparse / examples / testformatters.js View on Github external
title:
      This text
    should be indented
      exactly like it is here

  --bar BAR   bar help
*/


print('TEST argparse.RawTextHelpFormatter');

parser = new argparse.ArgumentParser({
  debug: true,
  prog: 'PROG',
  formatterClass: argparse.RawTextHelpFormatter,
  description: 'Keep the formatting\n' +
               '    exactly as it is written\n' +
               '\n' +
               'here\n'
});

parser.addArgument([ '--baz' ], {
  help: '    baz help should also\n' +
        'appear as given here'
});

a = parser.addArgument([ '--foo' ], {
  help: '  foo help should also\n' +
        'appear as given here'
});