@antora/cli
Advanced tools
Comparing version 2.3.0-alpha.1 to 2.3.0-alpha.2
@@ -50,3 +50,3 @@ #!/usr/bin/env node | ||
.name('antora') | ||
.version(VERSION, '-v, --version') | ||
.version(VERSION, '-v, --version', 'Output the version number.') | ||
.description('A modular, multi-repository documentation site generator for AsciiDoc.') | ||
@@ -53,0 +53,0 @@ .usage('[options] [[command] [args]]') |
@@ -6,15 +6,11 @@ 'use strict' | ||
const helpInformation = Command.prototype.helpInformation | ||
const stringify = JSON.stringify | ||
const QUOTED_DEFAULT_VALUE_RX = / \(default: "([^"]+)"\)/ | ||
// TODO include common options when outputting help for a (sub)command | ||
Command.prototype.helpInformation = function () { | ||
return helpInformation | ||
.call(this) | ||
.split(/^/m) | ||
.reduce((accum, line) => { | ||
~line.indexOf('"') ? accum.push(line.replace(QUOTED_DEFAULT_VALUE_RX, ' (default: $1)')) : accum.push(line) | ||
return accum | ||
}, []) | ||
.join('') | ||
// NOTE override stringify to coerce to string normally | ||
JSON.stringify = (val) => `${val}` | ||
const helpInfo = helpInformation.call(this) | ||
JSON.stringify = stringify | ||
return helpInfo | ||
} |
@@ -9,5 +9,3 @@ 'use strict' | ||
getOptions(convictConfig).forEach((option) => { | ||
if (!(exclude && exclude.includes(option.name))) { | ||
this.option(option.form, option.description, option.default) | ||
} | ||
if (!(exclude && exclude.includes(option.name))) this.option(option.form, option.description, option.default) | ||
}) | ||
@@ -31,5 +29,4 @@ return this | ||
if (Array.isArray(format)) { | ||
option.form += ` <${format.join('|')}>` | ||
//option.form += ` <${arg.substr(arg.lastIndexOf('-') + 1, arg.length)}>` | ||
//option.description += ` (${format.join(', ')})` | ||
option.form += ' <option>' | ||
option.description += ` (options: ${format.join(', ').replace(/, ([^,]+)$/, ', or $1')})` | ||
} else if (format !== 'boolean') { | ||
@@ -39,3 +36,3 @@ option.form += ` <${arg.substr(arg.lastIndexOf('-') + 1, arg.length)}>` | ||
if (default_ === null) { | ||
option.mandatory = true | ||
//option.mandatory = true | ||
option.description += ' (required)' | ||
@@ -42,0 +39,0 @@ } else if (default_ && (typeof default_ !== 'object' || default_.toString() !== '[object Object]')) { |
{ | ||
"name": "@antora/cli", | ||
"version": "2.3.0-alpha.1", | ||
"version": "2.3.0-alpha.2", | ||
"description": "The command line interface for Antora.", | ||
@@ -21,4 +21,4 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/playbook-builder": "2.3.0-alpha.1", | ||
"commander": "~3.0" | ||
"@antora/playbook-builder": "2.3.0-alpha.2", | ||
"commander": "~4.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10068
168
+ Added@antora/playbook-builder@2.3.0-alpha.2(transitive)
+ Addedcommander@4.0.1(transitive)
- Removed@antora/playbook-builder@2.3.0-alpha.1(transitive)
- Removedcommander@3.0.2(transitive)
Updatedcommander@~4.0