Skip to content

Commit 21c46a6

Browse files
committed
ls: Init
1 parent 64cfdd2 commit 21c46a6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • implement-shell-tools/ls

implement-shell-tools/ls/ls.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import argparse
2+
3+
parser = argparse.ArgumentParser(prog="ls", description="List directory contents. Ignore files and directories starting with a '.' by default")
4+
parser.add_argument("-1", help="List one file per line.", action="store_true")
5+
parser.add_argument("-a", help="Do not ignore hidden files (files with names that start with '.').", action="store_true")
6+
parser.add_argument("path", help="The directory path (optional).", default=".", nargs="?")
7+
8+
args = parser.parse_args()
9+

0 commit comments

Comments
 (0)