Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix args2string missing initial space #47

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rclone_python/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.1.14"
VERSION = "0.1.15"
5 changes: 4 additions & 1 deletion rclone_python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

def args2string(args: List[str]) -> str:
# separate flags/ named arguments by a space
return " ".join(args)
if args:
return " " + " ".join(args)

return ""


def run_cmd(
Expand Down
15 changes: 15 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from rclone_python.utils import args2string


def test_args2string():
args = []

result = args2string(args)

assert result == ""

args = ["--links", "--transfers", "40"]

result = args2string(args)

assert result == " --links --transfers 40"
Loading