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

map config groups to option groups instead of subcommands #551

Open
ntessore opened this issue Jan 21, 2021 · 1 comment
Open

map config groups to option groups instead of subcommands #551

ntessore opened this issue Jan 21, 2021 · 1 comment

Comments

@ntessore
Copy link

Is there currently a way to map config file groups (i.e. [mygroup]) to option groups defined in an app?

Use case is a program with a number of subcommands that share a very large number of options, which are read from a config file, and are grouped for clarity.

@phlptp
Copy link
Collaborator

phlptp commented Nov 3, 2021

I believe you can use the alias option on option_groups, this will allow the group name to be used in the config.

app.add_option_group("ogroup")->alias("ogroup");
[default]
val=1
[ogroup]
val2=2

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