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

missing parseargs #13282

Merged
merged 2 commits into from
Mar 1, 2023
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
4 changes: 2 additions & 2 deletions conan/cli/commands/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import sys

from conan.api.output import cli_out_write
from conan.cli.command import conan_command, conan_subcommand
from conan.cli.commands import default_json_formatter, default_text_formatter
Expand Down Expand Up @@ -57,6 +55,7 @@ def config_home(conan_api, parser, subparser, *args):
"""
Show the Conan home folder.
"""
parser.parse_args(*args)
return conan_api.config.home()


Expand All @@ -65,4 +64,5 @@ def config_list(conan_api, parser, subparser, *args):
"""
Show all the Conan available configurations: core and tools.
"""
parser.parse_args(*args)
return BUILT_IN_CONFS
8 changes: 6 additions & 2 deletions conans/test/integration/command/config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ def test_config_home_default(self):
client.run("config home")
assert f"{client.cache.cache_folder}\n" == client.stdout

client.run("config home --format=text")
assert f"{client.cache.cache_folder}\n" == client.stdout
client.run("config home --format=text", assert_error=True)
# It is not possible to use --format=text explicitly
assert "--format=text" in client.out

def test_api_uses_env_var_home(self):
cache_folder = os.path.join(temp_folder(), "custom")
Expand All @@ -47,6 +48,9 @@ def test_config_list():
client.run("config list --format=json")
assert f"{json.dumps(BUILT_IN_CONFS, indent=4)}\n" == client.stdout

client.run("config list unexpectedarg", assert_error=True)
assert "unrecognized arguments: unexpectedarg" in client.out


def test_config_install():
tc = TestClient()
Expand Down