From 3bc646082998cda73956f2175ac7514f884b1bae Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Thu, 19 Oct 2017 19:21:38 -0500 Subject: [PATCH] Updating documentation for --help for boolean values. --- src/count.ts | 25 +++++++++++++++++++++---- tsconfig.json | 11 ++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/count.ts b/src/count.ts index bf2931c..2137986 100644 --- a/src/count.ts +++ b/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); diff --git a/tsconfig.json b/tsconfig.json index c5acc28..f18cb90 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,14 +2,19 @@ "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, "sourceMap": true, "experimentalDecorators": true } -} +} \ No newline at end of file