Skip to content

Commit ddbae1a

Browse files
committed
Create cat.mjs file and define the initial implementation
1 parent 668b6a3 commit ddbae1a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

implement-shell-tools/cat/cat.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { program } from "commander";
2+
import { promises as fs } from "node:fs";
3+
4+
program.name("cat");
5+
program.description("simple cat clone");
6+
program.option("-n, --number", "number all output lines");
7+
program.option("-b, --number-nonblank", "number non-empty output lines");
8+
program.argument("[paths...]", "file(s) to process");
9+
program.parse();
10+
11+
const { number, numberNonblank } = program.opts();
12+
const paths = program.args;

0 commit comments

Comments
 (0)