@antora/cli
Advanced tools
Comparing version 2.3.0-alpha.2 to 2.3.0-beta.1
@@ -14,4 +14,4 @@ #!/usr/bin/env node | ||
async function run () { | ||
const result = cli.parse(process.argv, { defaultCommand: 'generate' }) | ||
async function run (argv = process.argv) { | ||
const result = cli.parse(argv.length < 3 ? [...argv, 'help'] : argv) | ||
/* istanbul ignore else */ | ||
@@ -22,7 +22,2 @@ if (cli._promise) await cli._promise | ||
//process.on('unhandledRejection', (reason) => { | ||
// console.error(`An unexpected error occurred: Unhandled promise rejection: ${reason.stack}`) | ||
// process.exitCode = 1 | ||
//}) | ||
function exitWithError (err, showStack, msg = undefined) { | ||
@@ -61,3 +56,3 @@ msg = showStack ? err.stack : `error: ${msg || err.message}\nAdd the --stacktrace option to see the cause.` | ||
cli | ||
.command('generate <playbook>') | ||
.command('generate <playbook>', { isDefault: true }) | ||
.description('Generate a documentation site specified in <playbook>.') | ||
@@ -64,0 +59,0 @@ .optionsFromConvict(convict(configSchema), { exclude: 'playbook' }) |
@@ -6,4 +6,3 @@ 'use strict' | ||
require('./commander/options-from-convict') | ||
require('./commander/parse-with-default-command') | ||
module.exports = commander |
'use strict' | ||
const { Command } = require('commander') | ||
const { helpInformation } = Command.prototype | ||
const { stringify } = JSON | ||
const helpInformation = Command.prototype.helpInformation | ||
const stringify = JSON.stringify | ||
// TODO include common options when outputting help for a (sub)command | ||
Command.prototype.helpInformation = function () { | ||
const nonTTYColumns = 'columns' in process.stdout ? undefined : (process.stdout.columns = process.env.COLUMNS || 80) | ||
// NOTE override stringify to coerce to string normally | ||
@@ -14,3 +14,4 @@ JSON.stringify = (val) => `${val}` | ||
JSON.stringify = stringify | ||
if (nonTTYColumns) delete process.stdout.columns | ||
return helpInfo | ||
} |
{ | ||
"name": "@antora/cli", | ||
"version": "2.3.0-alpha.2", | ||
"version": "2.3.0-beta.1", | ||
"description": "The command line interface for Antora.", | ||
@@ -21,6 +21,7 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/playbook-builder": "2.3.0-alpha.2", | ||
"commander": "~4.0" | ||
"@antora/playbook-builder": "2.3.0-beta.1", | ||
"commander": "~5.0" | ||
}, | ||
"devDependencies": { | ||
"@antora/site-publisher": "2.3.0-beta.1", | ||
"convict": "~5.2", | ||
@@ -27,0 +28,0 @@ "fs-extra": "~8.1", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
9374
4
7
150
5
+ Added@antora/playbook-builder@2.3.0-beta.1(transitive)
+ Addedcamelcase-keys@6.2.2(transitive)
+ Addedcommander@5.0.0(transitive)
- Removed@antora/playbook-builder@2.3.0-alpha.2(transitive)
- Removedcamelcase-keys@6.1.2(transitive)
- Removedcommander@4.0.1(transitive)
Updatedcommander@~5.0