Skip to content

Commit b3faa6b

Browse files
committed
Add ls.py and setup the basic program.
1 parent 7740eae commit b3faa6b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import argparse
2+
import os
3+
4+
parser = argparse.ArgumentParser(prog="ls",
5+
description="simple ls clone")
6+
7+
parser.add_argument("-1",
8+
dest="one_per_line",
9+
action="store_true",
10+
help="list one file per line")
11+
12+
parser.add_argument("-a",
13+
action="store_true",
14+
help="show hidden files")
15+
16+
parser.add_argument("filepath",
17+
nargs="?",
18+
default=".")
19+
20+
args = parser.parse_args()

0 commit comments

Comments
 (0)