Skip to content
Commit 8813537c authored by Ryan Roberts's avatar Ryan Roberts
Browse files

cli: Generalize FASTPATH_LIBRARY into a key-value store



Add a general purpose key-value store to fastpath to contain user
configuration items. The store is a file in INI format, stored at
~/.fastpathconfig. For now it is only possible to set/modify the values
by directly editing the file. But we may add a get/set interface to
simplify this in future.

Values have a category and a name. The combined key is referred to as
"<category>.<name>" (always lower case). It is possible to override a
given value using an environment variable of the form
"FASTPATH_<CATEGORY>_<NAME>" (always upper case). Note that values in
the "global" category can also use the form "FASTPATH_<NAME>", which
conveniently allows compatibility with the existing FASTPATH_LIBRARY
environment variable.

The getter API, getvar() takes strings for category and name and returns
the string value, if it is defined, or None if it isn't. There is
deliberately no global list of valid keys; they are free to expand (and
contract) as needed.

Our first user is global.library.

Signed-off-by: Ryan Roberts's avatarRyan Roberts <ryan.roberts@arm.com>
parent 0529cb51
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment