Skip to content

Commit d843352

Browse files
argparse information added to ls.py
1 parent 5f62f75 commit d843352

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import argparse
2+
3+
parser = argparse.ArgumentParser(
4+
prog="py-ls",
5+
description="A Python implementation of the Unix ls command",
6+
)
7+
8+
parser.add_argument("-1", action="store_true", help="List one file per line")
9+
parser.add_argument("-a", "--all", action="store_true", help="Include directory entries whose names begin with a dot (.)")
10+
parser.add_argument("path", nargs="+", help="The file path to process")
11+
12+
args = parser.parse_args()
13+

0 commit comments

Comments
 (0)