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 function args(argv) {
|
||||
export function args(argv)
|
||||
{
|
||||
return argv
|
||||
.help("help")
|
||||
|
||||
.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-end', '')
|
||||
|
@ -18,10 +24,20 @@ export function args(argv) {
|
|||
.boolean('table-header')
|
||||
.default('table-header', false)
|
||||
|
||||
.alias('t', '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')
|
||||
.alias('s', 'separator')
|
||||
.describe(
|
||||
'separator',
|
||||
'If provided, then the word counts will have comma separators ' +
|
||||
'for thousands.'
|
||||
)
|
||||
|
||||
.alias('o', 'output')
|
||||
.default('output', '-')
|
||||
|
@ -30,7 +46,8 @@ export function args(argv) {
|
|||
.argv;
|
||||
}
|
||||
|
||||
export function run(argv) {
|
||||
export function run(argv)
|
||||
{
|
||||
var files = argv._.splice(1);
|
||||
var data = scanner.scanFiles(argv, files);
|
||||
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": ["es6", "dom"],
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"types": ["node"],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"declaration": true,
|
||||
"noImplicitAny": false,
|
||||
"strictNullChecks": true,
|
||||
|
|
Loading…
Reference in a new issue