Corrected the indentation and added a test to cover the optional configuration object that can be passed to commandDir

This commit is contained in:
jan-molak
2016-08-08 20:10:57 +01:00
parent 18d922366a
commit 79aec36f24

View File

@@ -236,10 +236,10 @@ function completion_async() {
}
function Argv$help() {
var yargs1 = yargs
.usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
yargs1.help().argv;
var argv = yargs
.usage("$0 -operand1 number -operand2 number -operation [add|subtract]")
.help()
.argv;
}
function Argv$showHelpOnFail() {
@@ -323,8 +323,23 @@ function Argv$reset() {
}
}
// http://yargs.js.org/docs/#methods-commanddirdirectory-opts
function Argv$commandDir() {
var ya = yargs
.commandDir('.')
.argv
}
// http://yargs.js.org/docs/#methods-commanddirdirectory-opts
function Argv$commandDirWithOptions() {
var ya = yargs
.commandDir('.', {
recurse: false,
extensions: ['js'],
visit: (commandObject: any, pathToFile: string, filename: string) => { },
include: /.*\.js$/,
exclude: /.*\.spec.js$/,
})
.argv
}