b2
b2 copied to clipboard
Access CLI set variables independently.
Make sure you completed the following tasks
- [x] I searched the discussions
- [x] I searched the closed and open issues
Describe your use case
It's useful to distinguish between variables set in the environment, by the -sX=Y CLI option, and locally or globally in Jam files for configuration use. But it's currently convoluted, i.e. hard, to check if a variable is set because it's given with -sX=Y or in environment as both use the global module to store the variables.
Describe the solution you'd like
Create a way to store the -sX=Y variables separately. Likeliest implementation if to add those variables to a .CLI module like we do with .ENVIRON module.
For context: Given a possible setting ICU_PATH it would make sense to have the following order possible:
- When
-s ICU_PATH=xis given, usex - Otherwise if
path-constant ICU_PATH : yis set in the project-config, usey - Otherwise if an env variable
ICU_PATHexists use that - Otherwise empty
Currently the combination that env variables and CLI args are returned by module.peek makes this impossible which means that either you cannot overwrite the project-config with -s or an env variable would overwrite the project-config. Both don't make sense from a users perspective.