mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 10:19:24 +02:00
node_modules
This commit is contained in:
parent
6fa46f4e34
commit
680eb33f0d
4375 changed files with 1042080 additions and 6 deletions
36
node_modules/argparse/examples/arguments.js
generated
vendored
Normal file
36
node_modules/argparse/examples/arguments.js
generated
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
var parser = new ArgumentParser({
|
||||
version: '0.0.1',
|
||||
addHelp: true,
|
||||
description: 'Argparse examples: arguments'
|
||||
});
|
||||
parser.addArgument(
|
||||
[ '-f', '--foo' ],
|
||||
{
|
||||
help: 'foo bar'
|
||||
}
|
||||
);
|
||||
parser.addArgument(
|
||||
[ '-b', '--bar' ],
|
||||
{
|
||||
help: 'bar foo'
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
parser.printHelp();
|
||||
console.log('-----------');
|
||||
|
||||
var args;
|
||||
args = parser.parseArgs('-f 1 -b2'.split(' '));
|
||||
console.dir(args);
|
||||
console.log('-----------');
|
||||
args = parser.parseArgs('-f=3 --bar=4'.split(' '));
|
||||
console.dir(args);
|
||||
console.log('-----------');
|
||||
args = parser.parseArgs('--foo 5 --bar 6'.split(' '));
|
||||
console.dir(args);
|
||||
console.log('-----------');
|
Loading…
Add table
Add a link
Reference in a new issue