diff options
| -rw-r--r-- | examples/dumpvars.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/dumpvars.py b/examples/dumpvars.py index 5ce65c2..0f8ab43 100644 --- a/examples/dumpvars.py +++ b/examples/dumpvars.py @@ -1,5 +1,5 @@ -# Shows a list of all (set) environment variables referenced in the Kconfig -# files, together with their values. +# Prints all (set) environment variables referenced in the Kconfig files +# together with their values, as a list of assignments. # # Note: This only works for environment variables referenced via the $(FOO) # preprocessor syntax. The older $FOO syntax is maintained for backwards @@ -11,5 +11,5 @@ import sys import kconfiglib -for var in kconfiglib.Kconfig(sys.argv[1]).env_vars: - print("{:16} '{}'".format(var, os.environ[var])) +print(" ".join("{}='{}'".format(var, os.environ[var]) + for var in kconfiglib.Kconfig(sys.argv[1]).env_vars)) |
