Skip to content

Commit 46c5df5

Browse files
committed
update bugy lines of code
1 parent 524af1d commit 46c5df5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ program
77
.name("count-containing-lines-words-characters")
88
.description("Counts lines, words or characters in a file (or all files) inside a directory")
99
.option("-l, --line", "The number of lines in each file")
10-
.argument("<path>", "The file path to process");
10+
.argument("<path...>", "The file path to process");
1111

1212
program.parse();
1313

@@ -40,7 +40,7 @@ if (pathInfo.isFile()) {
4040
if (options.line) {
4141
console.log(`${stats.lines} ${path}`);
4242
} else {
43-
console.log(`${stats.lines} ${stats.words} ${stats.chars} ${path}`);
43+
console.log(`${stats.lines} ${stats.words} ${stats.characters} ${path}`);
4444
}
4545
} else if (pathInfo.isDirectory()) {
4646
const files = await fs.readdir(path);
@@ -52,7 +52,7 @@ if (pathInfo.isFile()) {
5252
if (options.line) {
5353
console.log(`${stats.lines} ${filePath}`);
5454
} else {
55-
console.log(`${stats.lines} ${stats.words} ${stats.chars} ${filePath}`);
55+
console.log(`${stats.lines} ${stats.words} ${stats.characters} ${filePath}`);
5656
}
5757
}
5858
}

0 commit comments

Comments
 (0)