Skip to content

Commit 0cb7c2e

Browse files
committed
updated arguments
1 parent a0572e4 commit 0cb7c2e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • implement-shell-tools/wc

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# Argument Handling
77
parser = argparse.ArgumentParser(
88
prog="wc",
9-
description="Give total word count of file",
9+
description="Print line, word, and byte counts for each file.",
1010
)
1111

1212
parser.add_argument("-l", action="store_true", help="Show line count")
1313
parser.add_argument("-w", action="store_true", help="Show word count")
1414
parser.add_argument("-c", action="store_true", help="Show byte size")
15-
parser.add_argument("message", nargs="*", help="File names to process")
15+
parser.add_argument("files names", nargs="*", help="File names to process")
1616

1717
args = parser.parse_args()
1818

@@ -63,11 +63,9 @@ def calculate_line_count(text):
6363
return 0
6464
return len(text.splitlines())
6565

66-
6766
def calculate_word_count(text):
6867
return len(text.split())
6968

70-
7169
def read_byte_size(file_name, cwd):
7270
file_path = os.path.join(cwd, file_name)
7371
return os.path.getsize(file_path)

0 commit comments

Comments
 (0)