mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-04 02:09:22 +02:00
node_modules
This commit is contained in:
parent
6fa46f4e34
commit
680eb33f0d
4375 changed files with 1042080 additions and 6 deletions
28
node_modules/argparse/examples/parents.js
generated
vendored
Normal file
28
node_modules/argparse/examples/parents.js
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var ArgumentParser = require('../lib/argparse').ArgumentParser;
|
||||
|
||||
var args;
|
||||
var parent_parser = new ArgumentParser({ addHelp: false });
|
||||
// note addHelp:false to prevent duplication of the -h option
|
||||
parent_parser.addArgument(
|
||||
['--parent'],
|
||||
{ type: 'int', description: 'parent' }
|
||||
);
|
||||
|
||||
var foo_parser = new ArgumentParser({
|
||||
parents: [ parent_parser ],
|
||||
description: 'child1'
|
||||
});
|
||||
foo_parser.addArgument(['foo']);
|
||||
args = foo_parser.parseArgs(['--parent', '2', 'XXX']);
|
||||
console.log(args);
|
||||
|
||||
var bar_parser = new ArgumentParser({
|
||||
parents: [ parent_parser ],
|
||||
description: 'child2'
|
||||
});
|
||||
bar_parser.addArgument(['--bar']);
|
||||
args = bar_parser.parseArgs(['--bar', 'YYY']);
|
||||
console.log(args);
|
Loading…
Add table
Add a link
Reference in a new issue