Skip to content

Commit 8544e56

Browse files
committed
done changes according to review
1 parent 0ddafe8 commit 8544e56

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

implement-shell-tools/cat/cat.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import os
21
import argparse
32

43
parser = argparse.ArgumentParser(
54
prog="cat",
65
description="Concatenate and print files",
76
)
87

9-
parser.add_argument("-n",action='store_true', help="Number the output lines, starting at 1")
10-
parser.add_argument("-b", action='store_true', help="Number the non-blank output lines, starting at 1")
8+
parser.add_argument(
9+
"-n", action="store_true", help="Number the output lines, starting at 1"
10+
)
11+
parser.add_argument(
12+
"-b", action="store_true", help="Number the non-blank output lines, starting at 1"
13+
)
1114
parser.add_argument("path", nargs="+", help="The path to search")
1215

1316
args = parser.parse_args()
@@ -16,18 +19,17 @@
1619
lines = file.readlines()
1720
line_num = 1
1821
for line in lines:
19-
lin = line.rstrip('\n')
22+
lin = line.rstrip("\n")
2023

2124
if args.b:
22-
if lin =="":
25+
if lin == "":
2326
print()
2427
else:
2528
print(line_num, lin)
26-
line_num += 1
29+
line_num += 1
2730
elif args.n:
2831
print(line_num, lin)
2932
line_num += 1
3033

3134
else:
3235
print(lin)
33-

implement-shell-tools/ls/ls.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,4 @@ def path_proceeding(path_argument):
3838
files = os.listdir(path_argument)
3939
arguments_proceeding(files)
4040

41-
42-
43-
path_proceeding(args.path)
44-
45-
46-
41+
path_proceeding(args.path)

0 commit comments

Comments
 (0)