@@ -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
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(-)