How to use the argparse.Const.SUPPRESS 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 DefinitelyTyped / DefinitelyTyped / types / argparse / argparse-tests.ts View on Github external
{
        help: 'bar foo',
        nargs: Const.ZERO_OR_MORE
    }
);
constExample.addArgument(
    '--baz',
    {
        help: 'baz',
        nargs: Const.OPTIONAL
    }
);
constExample.addArgument(
    '--qux',
    {
        help: Const.SUPPRESS
    }
);
constExample.addArgument(
    'quux',
    {
        help: 'quux',
        nargs: Const.REMAINDER
    }
);

constExample.printHelp();
console.log('-----------');

args = constExample.parseArgs('--foo x --bar --baz y --qux z a b c d e'.split(' '));
console.dir(args);
console.log('-----------');