Updating documentation for --help for boolean values.
This commit is contained in:
parent
dce80229c9
commit
3bc6460829
2 changed files with 29 additions and 7 deletions
25
src/count.ts
25
src/count.ts
|
@ -4,11 +4,17 @@ import * as scanner from "./scanner";
|
||||||
|
|
||||||
export var help = "Counts the number of works in the given input";
|
export var help = "Counts the number of works in the given input";
|
||||||
|
|
||||||
export function args(argv) {
|
export function args(argv)
|
||||||
|
{
|
||||||
return argv
|
return argv
|
||||||
.help("help")
|
.help("help")
|
||||||
|
|
||||||
.default('fields', ['_basename', '_words:r'])
|
.default('fields', ['_basename', '_words:r'])
|
||||||
|
.describe(
|
||||||
|
'fields',
|
||||||
|
'The dotted fields in the metadata to display, or _basename for ' +
|
||||||
|
'the name of the file, or _words to count the number of words. ' +
|
||||||
|
'Appending a `:r` at the end right-aligns the output.')
|
||||||
|
|
||||||
.default('table-start', '')
|
.default('table-start', '')
|
||||||
.default('table-end', '')
|
.default('table-end', '')
|
||||||
|
@ -18,10 +24,20 @@ export function args(argv) {
|
||||||
.boolean('table-header')
|
.boolean('table-header')
|
||||||
.default('table-header', false)
|
.default('table-header', false)
|
||||||
|
|
||||||
.alias('t', 'total')
|
|
||||||
.boolean('total')
|
.boolean('total')
|
||||||
.alias('s', 'separator')
|
.alias('t', 'total')
|
||||||
|
.describe(
|
||||||
|
'total',
|
||||||
|
'If provided, adds a special entry with a _basename of Totals ' +
|
||||||
|
'that adds up all the words.')
|
||||||
|
|
||||||
.boolean('separator')
|
.boolean('separator')
|
||||||
|
.alias('s', 'separator')
|
||||||
|
.describe(
|
||||||
|
'separator',
|
||||||
|
'If provided, then the word counts will have comma separators ' +
|
||||||
|
'for thousands.'
|
||||||
|
)
|
||||||
|
|
||||||
.alias('o', 'output')
|
.alias('o', 'output')
|
||||||
.default('output', '-')
|
.default('output', '-')
|
||||||
|
@ -30,7 +46,8 @@ export function args(argv) {
|
||||||
.argv;
|
.argv;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function run(argv) {
|
export function run(argv)
|
||||||
|
{
|
||||||
var files = argv._.splice(1);
|
var files = argv._.splice(1);
|
||||||
var data = scanner.scanFiles(argv, files);
|
var data = scanner.scanFiles(argv, files);
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,15 @@
|
||||||
"compileOnSave": true,
|
"compileOnSave": true,
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"lib": ["es6", "dom"],
|
"lib": [
|
||||||
|
"es6",
|
||||||
|
"dom"
|
||||||
|
],
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"types": ["node"],
|
"types": [
|
||||||
|
"node"
|
||||||
|
],
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
|
|
Loading…
Reference in a new issue