Skip to content
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
6 changes: 5 additions & 1 deletion src/manage/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ def __init__(self, args, root=None):
seen_cmd = True
elif a.startswith(("-", "/")):
a, sep, v = a.partition(":")
if not sep:
if sep:
if "=" in a:
a, sep, v_pre = a.partition("=")
v = f"{v_pre}:{v}"
else:
a, sep, v = a.partition("=")
set_next = a.lstrip("-/").lower()
try:
Expand Down
22 changes: 22 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,25 @@ def test_legacy_listpaths_command_help(assert_log, patched_installs):
assert_log(
assert_log.skip_until(r".*List command.+py list.+"),
)


def test_install_command_args():
# This is not meant to be exhaustive test of every possible option, but
# should cover all of the code paths in BaseCommand.__init__.
for args in [
["-v", "-y"],
["--v", "--y"],
["/v", "/y"],
]:
cmd = commands.InstallCommand(args)
assert cmd.log_level == logging.VERBOSE
assert not cmd.confirm

for args in [
["--log", "C:\\LOG.txt"],
["/log", "C:\\LOG.txt"],
["--log:C:\\LOG.txt"],
["--log=C:\\LOG.txt"],
]:
cmd = commands.InstallCommand(args)
assert cmd.log_file == "C:\\LOG.txt"
Loading