diff mbox series

[4/5] bitbake-setup: add 'metavar' for self-descriptive parameters

Message ID 20251012174727.4191604-4-alex.kanavin@gmail.com
State New
Headers show
Series [1/5] bitbake-setup: correct 'setting' to 'settings' in a couple of help texts | expand

Commit Message

Alexander Kanavin Oct. 12, 2025, 5:47 p.m. UTC
From: Johannes Schneider <johannes.schneider@leica-geosystems.com>

Add a metavar to the argparse options to have a self-descriptive help text.
Otherwise argpase defaults to use the argument name in all-uppercase.

Before:

usage: bitbake-setup [-h] [-d] [-q] [--color COLOR] [--no-network] [--global-settings GLOBAL_SETTINGS] [--setting SETTING SETTING SETTING]
                     {list,init,status,update,install-buildtools,settings} ...

After:

usage: bitbake-setup [-h] [-d] [-q] [--color COLOR] [--no-network] [--global-settings PATH] [--setting SECTION SETTING VALUE]
                     {list,init,status,update,install-buildtools,settings} ...

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 bin/bitbake-setup | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/bin/bitbake-setup b/bin/bitbake-setup
index 94514fd29..94e38b472 100755
--- a/bin/bitbake-setup
+++ b/bin/bitbake-setup
@@ -751,8 +751,9 @@  def main():
     parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
     parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
     parser.add_argument('--no-network', action='store_true', help='Do not check whether configuration repositories and layer repositories have been updated; use only the local cache.')
-    parser.add_argument('--global-settings', action='store', help='Path to the global settings file.')
-    parser.add_argument('--setting', default=[], dest='cmdline_settings', action='append', nargs=3,
+    parser.add_argument('--global-settings', action='store', metavar='PATH', help='Path to the global settings file.')
+    parser.add_argument('--setting', default=[], action='append', dest='cmdline_settings',
+                        nargs=3, metavar=('SECTION', 'SETTING', 'VALUE'),
                         help='Modify a setting (for this bitbake-setup invocation only), for example "--setting default top-dir-prefix /path/to/top/dir".')
 
     subparsers = parser.add_subparsers()