Message ID | 20251012174727.4191604-1-alex.kanavin@gmail.com |
---|---|
State | New |
Headers | show |
Series | [1/5] bitbake-setup: correct 'setting' to 'settings' in a couple of help texts | expand |
On Sun, 12 Oct 2025 at 19:47, Alexander Kanavin via lists.openembedded.org <alex.kanavin=gmail.com@lists.openembedded.org> wrote: > The new help text now reads: > usage: bitbake-setup settings [-h] [--global] {list,set,unset} ... > > and the respective sub commands: > usage: bitbake-setup settings list [-h] [--global] > usage: bitbake-setup settings set [-h] [--global] <section> <setting> <value> > usage: bitbake-setup settings unset [-h] [--global] <section> <setting> A note from me: I'm well aware this changes the settings UI yet again, at the 11th hour, and I'm feeling slightly uneasy sending it, but I still think it's a worthy improvement: - currently bitbake-setup tries to mimic older versions of 'git config' UI. But those older versions offer a confusing, convoluted mess, and shouldn't be imitated. This change adds a nice bit of structure and clarity to the operations, and follows what recently released versions of 'git config' do [1]. - the principle of reading global/local/commandline levels of settings and not creating them unless asked to and all other existing functionality is retained - the needed tweak is basically inserting 'set' into places where a setting is set, so it's a small one - something like this should be done now, otherwise we're stuck with a sub-optimal UI. [1] https://git-scm.com/docs/git-config (see also 'deprecated modes' section for the obsoleted UI) Alex
diff --git a/bin/bitbake-setup b/bin/bitbake-setup index 71b5b8de9..f24d39481 100755 --- a/bin/bitbake-setup +++ b/bin/bitbake-setup @@ -787,7 +787,7 @@ def main(): parser_settings.add_argument('key', nargs='?', help="Name of the setting") parser_settings.add_argument('value', nargs='?', help="Value of the setting") parser_settings.add_argument('--global', action='store_true', help="Modify the setting in a global settings file, rather than one specific to a top directory") - parser_settings.add_argument('--unset', nargs=2, help="Unset a setting, e.g. 'bitbake-setup setting --unset default registry' would revert to the registry setting in a global settings file") + parser_settings.add_argument('--unset', nargs=2, help="Unset a setting, e.g. 'bitbake-setup settings --unset default registry' would revert to the registry setting in a global settings file") parser_settings.add_argument('-l' ,'--list', action='store_true', help="List all settings with their values") parser_settings.set_defaults(func=settings_func) @@ -834,7 +834,7 @@ def main(): settings_func(top_dir, all_settings, args) return - print('Bitbake-setup is using {} as top directory ("bitbake-setup setting --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) + print('Bitbake-setup is using {} as top directory ("bitbake-setup settings --help" shows how to change it).\n'.format(top_dir, global_settings_path(args))) d = init_bb_cache(top_dir, all_settings, args) args.func(top_dir, all_settings, args, d)