summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index d69da5b..1b57821 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -4485,6 +4485,16 @@ def unescape(s):
"""
return _unescape_re_sub(r"\1", s)
+def standard_kconfig():
+ """
+ Helper for implementing tools. Loads either a top-level Kconfig specified
+ as an argument, or "Kconfig" otherwise. Returns the Kconfig instance.
+ """
+ if len(sys.argv) > 2:
+ sys.exit("usage: {} [Kconfig]".format(sys.argv[0]))
+
+ return Kconfig("Kconfig" if len(sys.argv) < 2 else sys.argv[1])
+
#
# Internal functions
#