Skip to content

Commit 655d823

Browse files
committed
Create wc.py file and define the basic structure.
1 parent 4ee9b6f commit 655d823

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import argparse
2+
3+
parser = argparse.ArgumentParser(prog="wc",
4+
description="simple wc clone")
5+
6+
parser.add_argument("-w",
7+
"--words",
8+
dest="words_count",
9+
action="store_true",
10+
help="print word count")
11+
12+
parser.add_argument("-l",
13+
"--lines",
14+
dest="lines_count",
15+
action="store_true",
16+
help="print line count")
17+
18+
parser.add_argument("-c",
19+
"--bytes",
20+
dest="byte_count",
21+
action="store_true",
22+
help="print byte count")
23+
24+
parser.add_argument("path")
25+
26+
args = parser.parse_args()

0 commit comments

Comments
 (0)