Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions man/scount.1
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ scount \- A tool to count logical lines of code and other metrics
.B scount
[\fB\-\-verbose\fR]
[\fB\-\-annotate\-counts\fR]
[\fB\-l\fR|\fB\-\-lines\fR]
[\fB\-\-stop\-on\-error\fR]
.I <PATH>
.SH DESCRIPTION
Expand Down Expand Up @@ -44,6 +45,11 @@ Mark counted logical lines and output the result.
.br
This option can only be used on a single file input.
.TP
.B \-l, \-\-lines
Compute and display only line-specific metrics.
.br
This includes logical and physical lines.
.TP
.B \-\-stop\-on\-error
Stop the processing on the first encountered error,
even for non\-critical errors. Without this option (the default),
Expand Down
8 changes: 7 additions & 1 deletion src/scount/c/arguments.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ AppArgs parseArgs(int argc, char** argv) {
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "--annotate-counts") == 0) {
args.annotateCounts = true;
} else if (strcmp(argv[i], "--lines") == 0
|| strcmp(argv[i], "-l") == 0) {
args.linesOnly = true;
} else if (strcmp(argv[i], "--stop-on-error") == 0) {
args.stopOnError = true;
} else if (strcmp(argv[i], "--verbose") == 0) {
Expand Down Expand Up @@ -60,7 +63,7 @@ AppArgs parseArgs(int argc, char** argv) {
}

void showUsage(void) {
logI("Usage: scount [--verbose] [--annotate-counts] [--stop-on-error] <PATH>");
logI("Usage: scount [--verbose] [--annotate-counts] [-l|--lines] [--stop-on-error] <PATH>");
}

void showVersion(AppArgs args) {
Expand Down Expand Up @@ -97,6 +100,9 @@ void showHelpText(void) {
logI(" [--annotate-counts] Mark counted logical lines and output the result.");
logI(" This option can only be used on a single file input.");
logI(" ");
logI(" [-l|--lines] Compute and display only line-specific metrics.");
logI(" This includes logical and physical lines.");
logI(" ");
logI(" [--stop-on-error] Stop processing immediately when an error is encountered.");
logI(" ");
logI(" [--verbose] Enable verbose output.");
Expand Down
Loading