We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e155672 commit d2daa0eCopy full SHA for d2daa0e
1 file changed
implement-shell-tools/wc/wc.js
@@ -15,16 +15,9 @@ program.parse();
15
16
const argv = program.args;
17
18
-const path = argv[0];
19
-
20
const options = program.opts();
21
22
23
-if (argv.length < 1) {
24
- console.error("You must pass at least one path!");
25
- process.exit(1);
26
-}
27
28
function counter(item) {
29
const lines = item.trim().split("\n").length;
30
const words = item.split(/\s+/).filter(Boolean).length;
@@ -72,7 +65,7 @@ if (pathInfo.isFile()) {
72
65
} else if (options.character) {
73
66
console.log(`${stats.characters} ${filePath}`);
74
67
} else {
75
- console.log(`${stats.lines} ${stats.words} ${stats.characters} ${path}`);
68
+ console.log(`${stats.lines} ${stats.words} ${stats.characters} ${filePath}`);
76
69
}
77
70
78
71
totalLines += stats.lines;
0 commit comments