From f503ea39a10f685bf3fc2fb21f2748aad6c5ee99 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 6 Jun 2019 20:45:45 +0200 Subject: dumpvars: Make the output format copy-pasteable Have it write assignments on a single line that can be copy-pasted before a command. --- examples/dumpvars.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/dumpvars.py') 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)) -- cgit v1.2.3