Skip to contentSkip to conversation

bitbake-setup: clarify that default answer to prompts is no

PATCH Applied [email protected] 2 participants 2 messages Oct 1, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-setup: clarify that default answer to prompts is no

From: Paul Gortmaker <[email protected]>

It is common practice to put the default choice in upper case for yes/no interactive prompts, so that when people just hit enter, they know what they are getting. An example that linux users are probably familiar with is "sensors-detect" from the "lm-sensors" package.

Unify all the prompts to be the same and indicate that the default answer from hitting enter is a no with an upper case N. No functional changes.

---
 bin/bitbake-setup | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bin/bitbake-setup +3 -3
index 1fbb6549..0655ed6f 100755
@@ -403,7 +403,7 @@ def init_config(settings, args, d):
 
     print("Initializing a build in\n    {}".format(builddir))
     if not args.non_interactive:
-        y_or_n = input('Continue? y/n: ')
+        y_or_n = input('Continue? (y/N): ')
         if y_or_n != 'y':
             exit()
         print()
@@ -608,7 +608,7 @@ def write_settings(top_dir, force_replace, non_interactive=True):
         print('A new settings file will be created in\n    {}\n'.format(settings_path))
         print('A common site.conf file will be created, please edit or replace before running builds\n    {}\n'.format(siteconfpath))
         if not non_interactive:
-            y_or_n = input('Bitbake-setup will be configured with the above settings in {}, y/n: '.format(top_dir))
+            y_or_n = input('Bitbake-setup will be configured with the above settings in {}, (y/N): '.format(top_dir))
             if y_or_n != 'y':
                 print("\nYou can run 'bitbake-setup install-settings' to edit them before setting up builds")
                 exit()
@@ -654,7 +654,7 @@ def write_global_settings(settings_path, force_replace, non_interactive=True):
         print('Top directory prefix (where all top level directories are created) set to\n    {}\n'.format(settings['default']['top-dir-prefix']))
         print('Top directory name (this is added to the top directory prefix to form a top directory where builds are set up) set to\n    {}\n'.format(settings['default']['top-dir-name']))
         if not non_interactive:
-            y_or_n = input('Write out the global settings as specified above (y/n)? ')
+            y_or_n = input('Write out the global settings as specified above (y/N)? ')
             if y_or_n != 'y':
                 print("\nYou can run 'bitbake-setup install-global-settings' to edit them before setting up builds")
                 exit()
Signature · 1 line
2.17.1
#1 lore raw

Thanks, applied.

There was some discussion as to whether this should be Y/n (e.g. hit Enter to proceed). I'd rather err on the cautious side here, as people nowadays have muscle memory to agree and accept with anything and everything, and proceed as quickly as possible, they would do it here too, without reading what the tool is going to do, and only then realize it's not what they wanted.

Alex

Quoted 60 lines · Paul Gortmaker via lists.openembedded.org

From: Paul Gortmaker <[email protected]>

It is common practice to put the default choice in upper case for yes/no interactive prompts, so that when people just hit enter, they know what they are getting. An example that linux users are probably familiar with is "sensors-detect" from the "lm-sensors" package.

Unify all the prompts to be the same and indicate that the default answer from hitting enter is a no with an upper case N. No functional changes.

---
 bin/bitbake-setup | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bin/bitbake-setup +3 -4
index 1fbb6549..0655ed6f 100755
@@ -403,7 +403,7 @@ def init_config(settings, args, d):
 
     print("Initializing a build in\n    {}".format(builddir))
     if not args.non_interactive:
-        y_or_n = input('Continue? y/n: ')
+        y_or_n = input('Continue? (y/N): ')
         if y_or_n != 'y':
             exit()
         print()
@@ -608,7 +608,7 @@ def write_settings(top_dir, force_replace, non_interactive=True):
         print('A new settings file will be created in\n    {}\n'.format(settings_path))
         print('A common site.conf file will be created, please edit or replace before running builds\n    {}\n'.format(siteconfpath))
         if not non_interactive:
-            y_or_n = input('Bitbake-setup will be configured with the above settings in {}, y/n: '.format(top_dir))
+            y_or_n = input('Bitbake-setup will be configured with the above settings in {}, (y/N): '.format(top_dir))
             if y_or_n != 'y':
                 print("\nYou can run 'bitbake-setup install-settings' to edit them before setting up builds")
                 exit()
@@ -654,7 +654,7 @@ def write_global_settings(settings_path, force_replace, non_interactive=True):
         print('Top directory prefix (where all top level directories are created) set to\n    {}\n'.format(settings['default']['top-dir-prefix']))
         print('Top directory name (this is added to the top directory prefix to form a top directory where builds are set up) set to\n    {}\n'.format(settings['default']['top-dir-name']))
         if not non_interactive:
-            y_or_n = input('Write out the global settings as specified above (y/n)? ')
+            y_or_n = input('Write out the global settings as specified above (y/N)? ')
             if y_or_n != 'y':
                 print("\nYou can run 'bitbake-setup install-global-settings' to edit them before setting up builds")
                 exit()
--

2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18112): https://lists.openembedded.org/g/bitbake-devel/message/18112
Mute This Topic: https://lists.openembedded.org/mt/115537146/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-