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 bdfbbba commit 0b3d37dCopy full SHA for 0b3d37d
1 file changed
implement-shell-tools/wc/wc.js
@@ -66,6 +66,10 @@ for (const path of paths) {
66
}
67
68
69
+// if there's more than one file, print out a total
70
+// if a flag is not selected, then the value for that flag is 0
71
+// filter out anything with a total of 0
72
if (fileCount > 1) {
- console.log(`\t${totals.l}\t${totals.w}\t${totals.c} total`);
73
+ const totalsArr = Object.values(totals).filter((elem) => elem !== 0);
74
+ console.log(`\t${totalsArr.join("\t")} total`);
75
0 commit comments