Skip to content

Commit ef611c6

Browse files
committed
parser setup
1 parent 2d9a740 commit ef611c6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

  • implement-shell-tools/wc

‎implement-shell-tools/wc/wc.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import argparse
2+
import sys
3+
import os
4+
5+
parser = argparse.ArgumentParser(
6+
prog="a simple version of wc. Takes in one or more files.",
7+
description="ls command line tool which can accept -l -w -c cflags")
8+
9+
parser.add_argument("-l", action="store_true", help="show line count")
10+
parser.add_argument("-w", action="store_true", help="show word count")
11+
parser.add_argument("-c", action="store_true", help="show byte count")
12+
13+
parser.add_argument("paths", nargs="*", help="file(s) for which to show data")
14+
15+
args = parser.parse_args()

0 commit comments

Comments
 (0)