Skip to content

Commit 1900a28

Browse files
added a destination to handel the -1 as a string
1 parent d443669 commit 1900a28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • implement-shell-tools/ls

‎implement-shell-tools/ls/ls.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def ls(path='.', one_column=False, show_hidden=False):
1717

1818
def main():
1919
parser = argparse.ArgumentParser()
20-
parser.add_argument('-1', action='store_true', help='list one file per line')
20+
parser.add_argument('-1', dest='one_column', action='store_true', help='list one file per line')
2121
parser.add_argument('-a', action='store_true', help='show hidden files')
2222
parser.add_argument('path', nargs='?', default='.', help='directory to list')
2323
args = parser.parse_args()
2424

25-
ls(args.path, args.__dict__['1'], args.a)
25+
ls(args.path, args.one_column, args.a)
2626

2727
if __name__ == "__main__":
2828
main()

0 commit comments

Comments
 (0)