libucl icon indicating copy to clipboard operation
libucl copied to clipboard

Callback on missing variable?

Open IngwiePhoenix opened this issue 11 years ago • 3 comments

Is there a way how to do something if the configuration is encountering an unknown variable?

I want to use libucl for configuring a build tool. So I would need to look, if variable $CC is not defined, that it will be defined.

Kind regards, Ingwie.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

IngwiePhoenix avatar May 08 '14 11:05 IngwiePhoenix

Currently unknown variables are just treated as raw strings. For example, if you have the following definition:

key = "$TEST";

Where there is no such variable TEST then key would have value $TEST. I've introduced variables merely to define some cool features, such as $CURDIR but they are not very well designed a.t.m.

vstakhov avatar May 08 '14 11:05 vstakhov

Ohhh, I see. Though, I find variables quite useful, which is why I will be looking into at least adding environmental variables to the config file, so they can be used from the inside. Would be nice if actual variable definitions would be possible in a way - thru a pre-processor or such. Or, just a simple callback in place of the current fallback solution - which would already help. :) Am 08.05.2014 um 13:23 schrieb Vsevolod Stakhov [email protected]:

Currently unknown variables are just treated as raw strings. For example, if you have the following definition:

key = "$TEST"; Where there is no such variable TEST then key would have value $TEST. I've introduced variables merely to define some cool features, such as $CURDIR but they are not very well designed a.t.m.

— Reply to this email directly or view it on GitHub.

IngwiePhoenix avatar May 08 '14 11:05 IngwiePhoenix

I've added a common callback for variables to ucl.

vstakhov avatar May 18 '14 13:05 vstakhov