diff --git a/bin/d2l-license-checker b/bin/d2l-license-checker index be4bf3b..177256b 100755 --- a/bin/d2l-license-checker +++ b/bin/d2l-license-checker @@ -16,10 +16,17 @@ const OverrideHelper = require('../lib/override-helper'); const defaultConfigFilePath = '.licensechecker.json'; const argv = require('yargs') - .usage( - '$0 [project-path [config-file-path]]\n\n' + - ' If no project path is given, the current directory with be used\n' + - ` If no config path is given, the file /${defaultConfigFilePath} will be used as default.`) + .usage('$0 [project-path] [config-file-path]', '', yargs => { + yargs + .positional('project-path', { + describe: 'Path to the project from current directory.', + defaultDescription: 'current directory.' + }) + .positional('config-file-path', { + describe: 'Path to configuration file from current directory.', + defaultDescription: `/${defaultConfigFilePath}` + }) + }) .help('h') .alias('h', 'help') .alias('t', 'generate-template') @@ -32,8 +39,8 @@ const argv = require('yargs') .boolean(['d', 'p', 't']) .strict() .argv; -const projectDir = argv._[0] || process.cwd(); -const configFilePath = path.resolve(argv._[1] || path.join(projectDir, defaultConfigFilePath)); +const projectDir = argv.projectPath || process.cwd(); +const configFilePath = path.resolve(argv.configFilePath || path.join(projectDir, defaultConfigFilePath)); const configAcceptedEntries = ['manualOverrides', 'acceptedScopes', 'ignoreUnusedManualOverrides']; const spdxExceptions = ['Public-Domain', 'Project-Owner']; const specialExemptionPrefix = 'D2L-Open-Source-Special-Exemption'; diff --git a/package-lock.json b/package-lock.json index 702addc..43c4d10 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1986,9 +1986,9 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yargs": { - "version": "17.0.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.0.1.tgz", - "integrity": "sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==", + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.2.1.tgz", + "integrity": "sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q==", "requires": { "cliui": "^7.0.2", "escalade": "^3.1.1", diff --git a/package.json b/package.json index ad112bc..30a3c1a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "semver": "^7.3.5", "spdx-license-ids": "^3.0.10", "spdx-satisfies": "^5.0.1", - "yargs": "17.0.1" + "yargs": "^17.2.1" }, "devDependencies": { "chai": "^4.3.4",