# Shows a list of all (set) environment variables referenced in the Kconfig
# files, together with their values.
#
# Note: This only works for environment variables referenced via the $(FOO)
# preprocessor syntax. The older $FOO syntax is maintained for backwards
# compatibility.

import os
import sys

import kconfiglib


for var in kconfiglib.Kconfig(sys.argv[1]).env_vars:
    print("{:16} '{}'".format(var, os.environ[var]))

@@ -1,21 +1,12 @@
 # 
-Shows a list of
+Prints
  all
@@ -63,17 +63,16 @@
 nfig
-%0A#
  files
-,
+%0A#
  tog
@@ -94,16 +94,42 @@
 r values
+, as a list of assignments
 .%0A#%0A# No
@@ -337,110 +337,127 @@
 b%0A%0A%0A
-for var in kconfiglib.Kconfig(sys.argv%5B1%5D).env_vars:%0A    print(%22%7B:16%7D '%7B%7D'%22.format(var, os.environ%5Bvar%5D
+print(%22 %22.join(%22%7B%7D='%7B%7D'%22.format(var, os.environ%5Bvar%5D)%0A               for var in kconfiglib.Kconfig(sys.argv%5B1%5D).env_vars
 ))%0A

Make the output format copy-pasteable