Skip to content

Commit ec4de6a

Browse files
committed
for the case of a dire print the total coutner
1 parent 8a546e1 commit ec4de6a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,12 @@ if (pathInfo.isFile()) {
7272
}
7373
}
7474

75+
}
76+
77+
if (fileCount > 1) {
78+
if (options.line) {
79+
console.log(`${totalLines} total`);
80+
} else {
81+
console.log(`${totalLines} ${totalWords} ${totalCharacters} total`);
82+
}
7583
}

0 commit comments

Comments
 (0)