Skip to content

Commit 0f51192

Browse files
committed
fix(docs): more accurate "--help"
1 parent 91d6c48 commit 0f51192

File tree

2 files changed

+34
-35
lines changed

2 files changed

+34
-35
lines changed

README.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,34 @@ $ npx code-complexity <path-to-git-directory or URL> [options]
2828
## Help
2929

3030
```text
31-
Usage: code-complexity <target> [options]
32-
33-
Measure the churn/complexity score. Higher values mean hotspots where refactorings should happen.
34-
35-
Options:
36-
-V, --version output the version number
37-
--filter <strings> list of globs (comma separated) to filter
38-
-cs, --complexity-strategy [strategy] choose the complexity strategy to analyze your codebase with (allowed values: sloc, cyclomatic, halstead).
39-
-f, --format [format] format results using table, json or csv
40-
-l, --limit [limit] limit the number of files to output
41-
-i, --since [since] limit analysis to commits more recent in age than date
42-
-u, --until [until] limit analysis to commits older in age than date
43-
-s, --sort [sort] sort results (allowed valued: score, churn, complexity or file)
44-
-d, --directories display values for directories instead of files
45-
-mb, --max-buffer [maxBuffer] set the max buffer size for git log (in bytes)
46-
-h, --help display help for command
47-
48-
Examples:
49-
50-
$ code-complexity .
51-
$ code-complexity https://github.com/simonrenoult/code-complexity
52-
$ code-complexity foo --limit 3
53-
$ code-complexity ../foo --sort score
54-
$ code-complexity /foo/bar --filter 'src/**,!src/front/**'
55-
$ code-complexity . --limit 10 --sort score
56-
$ code-complexity . --limit 10 --directories
57-
$ code-complexity . --limit 10 --sort score -cs halstead
58-
$ code-complexity . --since=2021-06-01 --limit 100
59-
$ code-complexity . --since=2021-04-01 --until=2021-07-01
60-
$ code-complexity . --max-buffer 64000000
31+
Usage: code-complexity <target> [options]
32+
33+
Options:
34+
-V, --version output the version number
35+
--filter <strings> list of globs (comma separated) to filter
36+
-cs, --complexity-strategy [sloc|cyclomatic|halstead] choose the complexity strategy to analyze your codebase with (default: "sloc")
37+
-f, --format [table|json|csv] format results
38+
-l, --limit [limit] limit the number of files to output
39+
-i, --since [since] limit analysis to commits more recent in age than date
40+
-u, --until [until] limit analysis to commits older in age than date
41+
-s, --sort [score|churn|complexity|file] sort results (allowed valued: score, churn, complexity or file)
42+
-d, --directories display values for directories instead of files
43+
-mb, --max-buffer [maxBuffer] set the max buffer size for git log (in bytes)
44+
-h, --help display help for command
45+
46+
Examples:
47+
48+
$ code-complexity .
49+
$ code-complexity https://github.com/simonrenoult/code-complexity
50+
$ code-complexity foo --limit 3
51+
$ code-complexity ../foo --sort score
52+
$ code-complexity /foo/bar --filter 'src/**,!src/front/**'
53+
$ code-complexity . --limit 10 --sort score
54+
$ code-complexity . --limit 10 --directories
55+
$ code-complexity . --limit 10 --sort score -cs halstead
56+
$ code-complexity . --since=2021-06-01 --limit 100
57+
$ code-complexity . --since=2021-04-01 --until=2021-07-01
58+
$ code-complexity . --max-buffer 64000000
6159
```
6260

6361
## Output

src/io/cli.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ function getRawCli(
5050
.option(
5151
"-cs, --complexity-strategy [sloc|cyclomatic|halstead]",
5252
"choose the complexity strategy to analyze your codebase with",
53-
/^(sloc|cyclomatic|halstead)$/i
53+
/^(sloc|cyclomatic|halstead)$/i,
54+
"sloc"
5455
)
5556
.option(
56-
"-f, --format [format]",
57-
"format results using table or json",
57+
"-f, --format [table|json|csv]",
58+
"format results",
5859
/^(table|json|csv)$/i
5960
)
6061
.option(
@@ -71,7 +72,7 @@ function getRawCli(
7172
"limit analysis to commits older in age than date"
7273
)
7374
.option(
74-
"-s, --sort [sort]",
75+
"-s, --sort [score|churn|complexity|file]",
7576
"sort results (allowed valued: score, churn, complexity or file)",
7677
/^(score|churn|complexity|file)$/i
7778
)
@@ -95,7 +96,7 @@ function getRawCli(
9596
"$ code-complexity ../foo --sort score",
9697
"$ code-complexity /foo/bar --filter 'src/**,!src/front/**'",
9798
"$ code-complexity . --limit 10 --sort score",
98-
"$ code-complexity . --limit 10 --modules",
99+
"$ code-complexity . --limit 10 --directories",
99100
"$ code-complexity . --limit 10 --sort score -cs halstead",
100101
"$ code-complexity . --since=2021-06-01 --limit 100",
101102
"$ code-complexity . --since=2021-04-01 --until=2021-07-01",

0 commit comments

Comments
 (0)