Skip to content

Commit

Permalink
docs: add help text for --update-only
Browse files Browse the repository at this point in the history
  • Loading branch information
uetchy committed Oct 14, 2020
1 parent 04ffd96 commit 88e4c56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ You can print to stdout by using the `-s` or `--stdout` option.

[ack]: http://beyondgrep.com/

### Only update existing ToC

Use `--update-only` or `-u` to only update the existing ToC. That is, the Markdown files without ToC will be left untouched. It is good if you want to use `doctoc` with `lint-staged`.

### Usage as a `git` hook

doctoc can be used as a [pre-commit](http://pre-commit.com) hook by using the
Expand Down
2 changes: 1 addition & 1 deletion doctoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function printUsageAndExit(isErr) {

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

outputFunc('Usage: doctoc [mode] [--entryprefix prefix] [--notitle | --title title] [--maxlevel level] [--all] <path> (where path is some path to a directory (e.g., .) or a file (e.g., README.md))');
outputFunc('Usage: doctoc [mode] [--entryprefix prefix] [--notitle | --title title] [--maxlevel level] [--all] [--update-only] <path> (where path is some path to a directory (e.g., .) or a file (e.g., README.md))');
outputFunc('\nAvailable modes are:');
for (var key in modes) {
outputFunc(' --%s\t%s', key, modes[key]);
Expand Down

0 comments on commit 88e4c56

Please sign in to comment.