diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2018-05-30 20:19:08 +0200 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2018-05-30 20:38:11 +0200 |
| commit | 791b930930b9ddcb752c97c8a8ef859b7afbeb0e (patch) | |
| tree | 269fac721dc55365f6582e521d511c87a19f03b0 /menuconfig.py | |
| parent | 38cca3bdeca7d91044e11ddf2193e07c5d223ad3 (diff) | |
Add tool helper for selecting the top-level Kconfig
standard_kconfig() gets the top-level Kconfig file from the first
command-line argument, defaulting to "Kconfig". This removes some
boilerplate from tools.
Diffstat (limited to 'menuconfig.py')
| -rwxr-xr-x | menuconfig.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/menuconfig.py b/menuconfig.py index 8ad3d94..584bf8e 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -95,7 +95,8 @@ from kconfiglib import Kconfig, \ BOOL, TRISTATE, STRING, INT, HEX, UNKNOWN, \ AND, OR, NOT, \ expr_value, split_expr, \ - TRI_TO_STR, TYPE_TO_STR + TRI_TO_STR, TYPE_TO_STR, \ + standard_kconfig # @@ -282,10 +283,7 @@ _expr_str = _expr_str_val # 'entry_points' can be used. It produces a handy menuconfig.exe launcher on # Windows. def _main(): - if len(sys.argv) > 2: - sys.exit("usage: {} [Kconfig]".format(sys.argv[0])) - - menuconfig(Kconfig("Kconfig" if len(sys.argv) < 2 else sys.argv[1])) + menuconfig(standard_kconfig()) def menuconfig(kconf): """ |
