diff mbox series

[PATCHv2,2/3] bitbake-layers: Remove the --force option for bitbake-config-build

Message ID 20251121204730.4057465-2-pkj@axis.com
State New
Headers show
Series [PATCHv2,1/3] bitbake-layers: Correct the help description for bitbake-config-build | expand

Commit Message

Peter Kjellerstedt Nov. 21, 2025, 8:47 p.m. UTC
There is currently no use for it, and its help message makes no sense in
the context of bitbake-config-build.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---

PATCHv2: Set the default for --force in a more idiomatic way.

 bin/bitbake-layers | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bin/bitbake-layers b/bin/bitbake-layers
index 1154eb6d2..c49a5f30e 100755
--- a/bin/bitbake-layers
+++ b/bin/bitbake-layers
@@ -35,9 +35,14 @@  def main():
         add_help=False)
     parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
     parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
-    parser.add_argument('-F', '--force', help='Forced execution: can be specified multiple times. -F will force add without recipe parse verification and -FF will additionally force the run withput layer parsing.', action='count', default=0)
+    if toolname == "bitbake-layers":
+        parser.add_argument('-F', '--force', help='Forced execution: can be specified multiple times. -F will force add without recipe parse verification and -FF will additionally force the run without layer parsing.', action='count')
     parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
 
+    # Set the default for --force here rather than above so that it is always
+    # defined even if the option is not available.
+    parser.set_defaults(force=0)
+
     global_args, unparsed_args = parser.parse_known_args()
 
     # Help is added here rather than via add_help=True, as we don't want it to