Skip to content

Commit 809a558

Browse files
committed
wc(ESM): scaffold command (placeholder, no behavior yet)
1 parent cf8040c commit 809a558

File tree

1 file changed

+21
-0
lines changed
  • implement-shell-tools/wc

1 file changed

+21
-0
lines changed

implement-shell-tools/wc/wc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)