Skip to content

Commit e609ff3

Browse files
committed
style:
1 parent 0d43179 commit e609ff3

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

  • implement-shell-tools/wc

implement-shell-tools/wc/wc.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
import argparse
22

3-
parser = argparse.ArgumentParser(prog= "wc",
4-
description="Count lines, words, and characters in one or more files.")
3+
parser = argparse.ArgumentParser(
4+
prog="wc", description="Count lines, words, and characters in one or more files."
5+
)
56

6-
parser.add_argument("-c",action="store_true",help="Count the number of characters.")
7-
parser.add_argument("-w",action="store_true", help="Count the number of words.")
8-
parser.add_argument("-l",action="store_true",help="Count the number of lines.")
9-
parser.add_argument("paths",nargs="+",help="Path(s) to the file(s) to process.")
7+
parser.add_argument("-c", action="store_true", help="Count the number of characters.")
8+
parser.add_argument("-w", action="store_true", help="Count the number of words.")
9+
parser.add_argument("-l", action="store_true", help="Count the number of lines.")
10+
parser.add_argument("paths", nargs="+", help="Path(s) to the file(s) to process.")
1011

1112

12-
total_results = {
13-
14-
}
13+
total_results = {}
1514

1615

17-
args =parser.parse_args()
18-
paths= args.paths;
16+
args = parser.parse_args()
17+
paths = args.paths
1918
no_flags = not args.c and not args.w and not args.l
2019

2120
for path in paths:
@@ -44,4 +43,3 @@
4443

4544
if len(paths) > 1:
4645
print(" ".join(map(str, total_results.values())), "total")
47-

0 commit comments

Comments
 (0)