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

feat: add base flag to info command #3779

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

SandrineP
Copy link
Collaborator

Adds one of the missing sub-command #3535

@SandrineP SandrineP added the release::enhancements For enhancements PRs or implementing features label Jan 30, 2025
@SandrineP SandrineP marked this pull request as ready for review January 30, 2025 16:19
libmamba/src/api/info.cpp Show resolved Hide resolved
libmamba/src/api/info.cpp Show resolved Hide resolved
auto& base = config.insert(
Configurable("base", false).group("cli").description("Display base environment path.")
);
subcom->add_flag("--base", base.get_cli_config<bool>(), base.description());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can mamba info --base be tested?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how to test it. Open to suggestions!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of testing that the usual information is not present and that an existing path is output?

Comment on lines 13 to 14
using namespace mamba;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for Configurable, which is a mamba::Configurable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, using namespace directive should be avoided as much as possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is done in /mamba/micromamba/src/list.cpp , which is why I originally went for it in /mamba/micromamba/src/info.cpp (but it used only once here, and more in list.cpp).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, we can remove (broad) using namespace directives in another PR.

@@ -22,6 +25,11 @@ set_info_command(CLI::App* subcom, mamba::Configuration& config)
init_info_parser(subcom, config);
static bool print_licenses;

auto& base = config.insert(
Configurable("base", false).group("cli").description("Display base environment path.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using this if this is possible?

Suggested change
Configurable("base", false).group("cli").description("Display base environment path.")
mamba::Configurable("base", false).group("cli").description("Display base environment path.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::enhancements For enhancements PRs or implementing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants