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 cf8040c commit 809a558Copy full SHA for 809a558
implement-shell-tools/wc/wc.js
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env node
2
+// wc.js — scaffold (no functionality yet)
3
+// Plan:
4
+// 1) single-file, no flags: print lines words bytes + filename
5
+// 2) multiple files: print per-file + "total"
6
+// 3) flags: -l (lines), -w (words), -c (bytes)
7
+
8
+import { pathToFileURL } from "node:url";
9
10
+function main() {
11
+ const args = process.argv.slice(2);
12
+ if (args.length === 0) {
13
+ console.error("Usage: node wc.js <file...> | [-l|-w|-c] <file...>");
14
+ process.exit(1);
15
+ }
16
+ console.log("wc: scaffold ready (implementation comes in next commit)");
17
+}
18
19
+// run only when executed directly
20
+const isDirect = import.meta.url === pathToFileURL(process.argv[1]).href;
21
+if (isDirect) main();
0 commit comments