From fbd8f5c1856d34481fbabf615cbf412bf8c95c4c Mon Sep 17 00:00:00 2001 From: Amey Kulkarni <29138700+ap-kulkarni@users.noreply.github.com> Date: Sat, 25 Sep 2021 23:44:11 +0530 Subject: [PATCH] Issue 6651: Added alias ls for dvc list (#6683) --- dvc/command/ls/__init__.py | 1 + tests/unit/command/ls/test_ls.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/dvc/command/ls/__init__.py b/dvc/command/ls/__init__.py index a44877f03..1b2317c6f 100644 --- a/dvc/command/ls/__init__.py +++ b/dvc/command/ls/__init__.py @@ -54,6 +54,7 @@ def add_parser(subparsers, parent_parser): ) list_parser = subparsers.add_parser( "list", + aliases=["ls"], parents=[parent_parser], description=append_doc_link(LIST_HELP, "list"), help=LIST_HELP, diff --git a/tests/unit/command/ls/test_ls.py b/tests/unit/command/ls/test_ls.py index c690d0ff5..7e7970c01 100644 --- a/tests/unit/command/ls/test_ls.py +++ b/tests/unit/command/ls/test_ls.py @@ -109,3 +109,8 @@ def test_show_colors(mocker, capsys, monkeypatch): "\x1b[01;34msrc\x1b[0m", "\x1b[01;32mrun.sh\x1b[0m", ] + + +def test_list_alias(): + cli_args = parse_args(["ls", "local_dir"]) + assert cli_args.func == CmdList