Skip to content

Commit e1f4d90

Browse files
committed
Updated help output
I reorganized, limited to 80 chars, added `--stdout`, added shortcut options, put a space between the path description to make it more readable, and also fixed ambiguous working in the stdOut function.
1 parent a376096 commit e1f4d90

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doctoc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function transformAndSave(files, mode, maxHeaderLevel, title, notitle, entryPref
4242

4343
changed.forEach(function (x) {
4444
if (stdOut) {
45-
console.log('==================\n\n"%s" should be updated', x.path)
45+
console.log('==================\n\n"%s" was not updated.', x.path)
4646
} else {
4747
console.log('"%s" will be updated', x.path);
4848
fs.writeFileSync(x.path, x.data, 'utf8');
@@ -54,7 +54,11 @@ function printUsageAndExit(isErr) {
5454

5555
var outputFunc = isErr ? console.error : console.info;
5656

57-
outputFunc('Usage: doctoc [mode] [--entryprefix prefix] [--notitle | --title title] [--maxlevel level] <path> (where path is some path to a directory (e.g., .) or a file (e.g., README.md))');
57+
outputFunc('Usage: doctoc <path> [--help | -h] [mode] [--maxlevel <level> | -m]\n' +
58+
'[--title <title> | -t] [--notitle | -T] [--stdout | -s]\n' +
59+
'[--entryprefix <prefix>]\n\n' +
60+
"<path> must be some path to a directory (e.g., .) or a file (e.g., README.md)");
61+
5862
outputFunc('\nAvailable modes are:');
5963
for (var key in modes) {
6064
outputFunc(' --%s\t%s', key, modes[key]);

0 commit comments

Comments
 (0)