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 62821e4 commit a324eefCopy full SHA for a324eef
1 file changed
implement-shell-tools/wc/wc.js
@@ -52,5 +52,11 @@ for (let i = 0; i < stringArr.length; i++) {
52
infoArr.push(arr.join(" "))
53
}
54
55
-if (infoArr.length > 1) infoArr.push([lines, words, bytes, "total"].join(" "))
+if (infoArr.length > 1) {
56
+ const totalArr = ["total"];
57
+ if (showByteCount) totalArr.unshift(bytes);
58
+ if (showWordCount) totalArr.unshift(words);
59
+ if (showLineCount) totalArr.unshift(lines);
60
+ infoArr.push(totalArr.join(" "))
61
+}
62
console.log(infoArr.join("\n"))
0 commit comments