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

Feature request: zef config subcommands for debugging #519

Open
dontlaugh opened this issue Jul 27, 2023 · 1 comment
Open

Feature request: zef config subcommands for debugging #519

dontlaugh opened this issue Jul 27, 2023 · 1 comment

Comments

@dontlaugh
Copy link

I'm looking into running Blin, and it relies on paring --help to find Zef's JSON config.

https://github.com/Raku/Blin/blob/253df4c042a1fb8cd0fd92ccedf9ce3fb9bcca70/lib/Blin/Tester/Zef.rakumod#L26-L27

It's understandable that parsing is required, since the automatic config paths seem volatile. Here's mine, for instance

CONFIGURATION /home/coleman/.raku/resources/2761BB503396E2B6CC3A6AC77C63CC0B8F2A7233.json

I propose a new subcommand namespace, config (or maybe zef debug could work), that simply evaluates/merges config sources, and prints them to stdout.

Blin's use case could then be accomplished with something like

zef config show --format=json | jq '.Repository[][].options.mirrors'

Prior art: kubectl config view, lxc config show, and more.

This is also an alternative to changing the bemavior of --help per #477

@ugexe
Copy link
Owner

ugexe commented Jul 29, 2023

Command line flags override configuration, so there isn't a merged configuration so to speak yet. We use the pattern of setting command line flag defaults from configuration. For instance:

:to(:$install-to) = %*ENV<ZEF_INSTALL_TO> // $CONFIG<DefaultCUR>,

with the problem there being there is not yet a centralized mapping of environment variables to a single configuration object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants