Skip to content

Commit 7d85fc5

Browse files
wc argparse info loaded
1 parent 8ee7c0e commit 7d85fc5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import argparse
2+
3+
parser = argparse.ArgumentParser(
4+
prog="py-wc",
5+
description="A Python implementation of the Unix wc command",
6+
)
7+
8+
parser.add_argument("-l", "--lines", help="Print the newline counts")
9+
parser.add_argument("-w", "--words", action="store_true", help="Print the word counts")
10+
parser.add_argument("-c", "--bytes", action="store_true", help="Print the byte counts")
11+
parser.add_argument("path", nargs="?", default=".", help="Directory to list")
12+
13+
args = parser.parse_args()
14+

0 commit comments

Comments
 (0)