Skip to content

Commit 45766e0

Browse files
committed
parse file arguments
1 parent c7449be commit 45766e0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import { program } from "commander";
2+
import fs from "node:fs";
3+
import process from "node:process";
24

35
program
46
.name("wc")
57
.description("Mimics the wc command line tool")
68
.option("-w")
79
.option("-c")
8-
.option("-l");
10+
.option("-l")
11+
.argument("<files...>", "file to process");
912

1013
program.parse();
1114

1215
const options = program.opts();
16+
const files = program.args;
1317

14-
console.log(options);
18+
console.log(files);

0 commit comments

Comments
 (0)