summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2023-01-06 15:09:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-09 14:21:01 +0000
commit654380885a167fb11d3918dd737ff02ce8716a71 (patch)
tree6c7a796669167f84da621d62975ceadf6f29c334
parentfc7d7a04d3920703aa5cc691579a0d3a46c5edd8 (diff)
downloadpoky-654380885a167fb11d3918dd737ff02ce8716a71.tar.gz
bitbake: Group and reorder options in bitbake help
Fixes [YOCTO #12018]. Also, I have included some small fixes: * added a '.' at the end of sentence where it was missing * split some long lines (Bitbake rev: 9257c48c3e36daaecb5e15da22d0bed24865f02c) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/main.py222
1 files changed, 122 insertions, 100 deletions
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 70b3845aab..1c87a02daa 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -122,64 +122,100 @@ def create_bitbake_parser():
122 """, 122 """,
123 formatter_class=BitbakeHelpFormatter, 123 formatter_class=BitbakeHelpFormatter,
124 allow_abbrev=False, 124 allow_abbrev=False,
125 add_help=False, # help is manually added below in a specific argument group
125 ) 126 )
126 127
127 parser.add_argument("--version", action="store_true", 128 general_group = parser.add_argument_group('General options')
128 help="Show programs version and exit") 129 task_group = parser.add_argument_group('Task control options')
130 exec_group = parser.add_argument_group('Execution control options')
131 logging_group = parser.add_argument_group('Logging/output control options')
132 server_group = parser.add_argument_group('Server options')
133 config_group = parser.add_argument_group('Configuration options')
129 134
130 parser.add_argument("-b", "--buildfile", 135 general_group.add_argument("targets", nargs="*", metavar="recipename/target",
136 help="Execute the specified task (default is 'build') for these target "
137 "recipes (.bb files).")
138
139 general_group.add_argument("-b", "--buildfile",
131 help="Execute tasks from a specific .bb recipe directly. WARNING: Does " 140 help="Execute tasks from a specific .bb recipe directly. WARNING: Does "
132 "not handle any dependencies from other recipes.") 141 "not handle any dependencies from other recipes.")
133 142
134 parser.add_argument("-k", "--continue", action="store_false", dest="halt", 143 general_group.add_argument("-s", "--show-versions", action="store_true",
135 help="Continue as much as possible after an error. While the target that " 144 help="Show current and preferred versions of all recipes.")
136 "failed and anything depending on it cannot be built, as much as " 145
137 "possible will be built before stopping.") 146 general_group.add_argument("-e", "--environment", action="store_true",
147 dest="show_environment",
148 help="Show the global or per-recipe environment complete with information"
149 " about where variables were set/changed.")
150
151 general_group.add_argument("-g", "--graphviz", action="store_true", dest="dot_graph",
152 help="Save dependency tree information for the specified "
153 "targets in the dot syntax.")
154
155 # @CHOICES@ is substituted out by BitbakeHelpFormatter above
156 general_group.add_argument("-u", "--ui",
157 default=os.environ.get('BITBAKE_UI', 'knotty'),
158 help="The user interface to use (@CHOICES@ - default %(default)s).")
159
160 general_group.add_argument("--version", action="store_true",
161 help="Show programs version and exit.")
162
163 general_group.add_argument('-h', '--help', action='help',
164 help='Show this help message and exit.')
165
138 166
139 parser.add_argument("-f", "--force", action="store_true", 167 task_group.add_argument("-f", "--force", action="store_true",
140 help="Force the specified targets/task to run (invalidating any " 168 help="Force the specified targets/task to run (invalidating any "
141 "existing stamp file).") 169 "existing stamp file).")
142 170
143 parser.add_argument("-c", "--cmd", 171 task_group.add_argument("-c", "--cmd",
144 help="Specify the task to execute. The exact options available " 172 help="Specify the task to execute. The exact options available "
145 "depend on the metadata. Some examples might be 'compile'" 173 "depend on the metadata. Some examples might be 'compile'"
146 " or 'populate_sysroot' or 'listtasks' may give a list of " 174 " or 'populate_sysroot' or 'listtasks' may give a list of "
147 "the tasks available.") 175 "the tasks available.")
148 176
149 parser.add_argument("-C", "--clear-stamp", dest="invalidate_stamp", 177 task_group.add_argument("-C", "--clear-stamp", dest="invalidate_stamp",
150 help="Invalidate the stamp for the specified task such as 'compile' " 178 help="Invalidate the stamp for the specified task such as 'compile' "
151 "and then run the default task for the specified target(s).") 179 "and then run the default task for the specified target(s).")
152 180
153 parser.add_argument("-r", "--read", action="append", dest="prefile", default=[], 181 task_group.add_argument("--runall", action="append", default=[],
154 help="Read the specified file before bitbake.conf.") 182 help="Run the specified task for any recipe in the taskgraph of the "
183 "specified target (even if it wouldn't otherwise have run).")
155 184
156 parser.add_argument("-R", "--postread", action="append", dest="postfile", default=[], 185 task_group.add_argument("--runonly", action="append",
157 help="Read the specified file after bitbake.conf.") 186 help="Run only the specified task within the taskgraph of the "
187 "specified targets (and any task dependencies those tasks may have).")
158 188
159 parser.add_argument("-v", "--verbose", action="store_true", 189 task_group.add_argument("--no-setscene", action="store_true",
160 help="Enable tracing of shell tasks (with 'set -x'). " 190 dest="nosetscene",
161 "Also print bb.note(...) messages to stdout (in " 191 help="Do not run any setscene tasks. sstate will be ignored and "
162 "addition to writing them to ${T}/log.do_<task>).") 192 "everything needed, built.")
163 193
164 parser.add_argument("-D", "--debug", action="count", default=0, 194 task_group.add_argument("--skip-setscene", action="store_true",
165 help="Increase the debug level. You can specify this " 195 dest="skipsetscene",
166 "more than once. -D sets the debug level to 1, " 196 help="Skip setscene tasks if they would be executed. Tasks previously "
167 "where only bb.debug(1, ...) messages are printed " 197 "restored from sstate will be kept, unlike --no-setscene.")
168 "to stdout; -DD sets the debug level to 2, where " 198
169 "both bb.debug(1, ...) and bb.debug(2, ...) " 199 task_group.add_argument("--setscene-only", action="store_true",
170 "messages are printed; etc. Without -D, no debug " 200 dest="setsceneonly",
171 "messages are printed. Note that -D only affects " 201 help="Only run setscene tasks, don't run any real tasks.")
172 "output to stdout. All debug messages are written "
173 "to ${T}/log.do_taskname, regardless of the debug "
174 "level.")
175 202
176 parser.add_argument("-q", "--quiet", action="count", default=0,
177 help="Output less log message data to the terminal. You can specify this more than once.")
178 203
179 parser.add_argument("-n", "--dry-run", action="store_true", 204 exec_group.add_argument("-n", "--dry-run", action="store_true",
180 help="Don't execute, just go through the motions.") 205 help="Don't execute, just go through the motions.")
181 206
182 parser.add_argument("-S", "--dump-signatures", action="append", 207 exec_group.add_argument("-p", "--parse-only", action="store_true",
208 help="Quit after parsing the BB recipes.")
209
210 exec_group.add_argument("-k", "--continue", action="store_false", dest="halt",
211 help="Continue as much as possible after an error. While the target that "
212 "failed and anything depending on it cannot be built, as much as "
213 "possible will be built before stopping.")
214
215 exec_group.add_argument("-P", "--profile", action="store_true",
216 help="Profile the command and save reports.")
217
218 exec_group.add_argument("-S", "--dump-signatures", action="append",
183 default=[], metavar="SIGNATURE_HANDLER", 219 default=[], metavar="SIGNATURE_HANDLER",
184 help="Dump out the signature construction information, with no task " 220 help="Dump out the signature construction information, with no task "
185 "execution. The SIGNATURE_HANDLER parameter is passed to the " 221 "execution. The SIGNATURE_HANDLER parameter is passed to the "
@@ -187,100 +223,86 @@ def create_bitbake_parser():
187 "may define more/less. none means only dump the signature, printdiff" 223 "may define more/less. none means only dump the signature, printdiff"
188 " means compare the dumped signature with the cached one.") 224 " means compare the dumped signature with the cached one.")
189 225
190 parser.add_argument("-p", "--parse-only", action="store_true", 226 exec_group.add_argument("--revisions-changed", action="store_true",
191 help="Quit after parsing the BB recipes.") 227 help="Set the exit code depending on whether upstream floating "
192 228 "revisions have changed or not.")
193 parser.add_argument("-s", "--show-versions", action="store_true",
194 help="Show current and preferred versions of all recipes.")
195
196 parser.add_argument("-e", "--environment", action="store_true",
197 dest="show_environment",
198 help="Show the global or per-recipe environment complete with information"
199 " about where variables were set/changed.")
200
201 parser.add_argument("-g", "--graphviz", action="store_true", dest="dot_graph",
202 help="Save dependency tree information for the specified "
203 "targets in the dot syntax.")
204 229
205 parser.add_argument("-I", "--ignore-deps", action="append",
206 dest="extra_assume_provided", default=[],
207 help="Assume these dependencies don't exist and are already provided "
208 "(equivalent to ASSUME_PROVIDED). Useful to make dependency "
209 "graphs more appealing")
210 230
211 parser.add_argument("-l", "--log-domains", action="append", dest="debug_domains", default=[], 231 logging_group.add_argument("-D", "--debug", action="count", default=0,
212 help="Show debug logging for the specified logging domains") 232 help="Increase the debug level. You can specify this "
233 "more than once. -D sets the debug level to 1, "
234 "where only bb.debug(1, ...) messages are printed "
235 "to stdout; -DD sets the debug level to 2, where "
236 "both bb.debug(1, ...) and bb.debug(2, ...) "
237 "messages are printed; etc. Without -D, no debug "
238 "messages are printed. Note that -D only affects "
239 "output to stdout. All debug messages are written "
240 "to ${T}/log.do_taskname, regardless of the debug "
241 "level.")
213 242
214 parser.add_argument("-P", "--profile", action="store_true", 243 logging_group.add_argument("-l", "--log-domains", action="append", dest="debug_domains",
215 help="Profile the command and save reports.") 244 default=[],
245 help="Show debug logging for the specified logging domains.")
216 246
217 # @CHOICES@ is substituted out by BitbakeHelpFormatter above 247 logging_group.add_argument("-v", "--verbose", action="store_true",
218 parser.add_argument("-u", "--ui", 248 help="Enable tracing of shell tasks (with 'set -x'). "
219 default=os.environ.get('BITBAKE_UI', 'knotty'), 249 "Also print bb.note(...) messages to stdout (in "
220 help="The user interface to use (@CHOICES@ - default %(default)s).") 250 "addition to writing them to ${T}/log.do_<task>).")
221 251
222 parser.add_argument("--token", dest="xmlrpctoken", 252 logging_group.add_argument("-q", "--quiet", action="count", default=0,
223 default=os.environ.get("BBTOKEN"), 253 help="Output less log message data to the terminal. You can specify this "
224 help="Specify the connection token to be used when connecting " 254 "more than once.")
225 "to a remote server.")
226 255
227 parser.add_argument("--revisions-changed", action="store_true", 256 logging_group.add_argument("-w", "--write-log", dest="writeeventlog",
228 help="Set the exit code depending on whether upstream floating " 257 default=os.environ.get("BBEVENTLOG"),
229 "revisions have changed or not.") 258 help="Writes the event log of the build to a bitbake event json file. "
259 "Use '' (empty string) to assign the name automatically.")
230 260
231 parser.add_argument("--server-only", action="store_true",
232 help="Run bitbake without a UI, only starting a server "
233 "(cooker) process.")
234 261
235 parser.add_argument("-B", "--bind", default=False, 262 server_group.add_argument("-B", "--bind", default=False,
236 help="The name/address for the bitbake xmlrpc server to bind to.") 263 help="The name/address for the bitbake xmlrpc server to bind to.")
237 264
238 parser.add_argument("-T", "--idle-timeout", type=float, dest="server_timeout", 265 server_group.add_argument("-T", "--idle-timeout", type=float, dest="server_timeout",
239 default=os.getenv("BB_SERVER_TIMEOUT"), 266 default=os.getenv("BB_SERVER_TIMEOUT"),
240 help="Set timeout to unload bitbake server due to inactivity, " 267 help="Set timeout to unload bitbake server due to inactivity, "
241 "set to -1 means no unload, " 268 "set to -1 means no unload, "
242 "default: Environment variable BB_SERVER_TIMEOUT.") 269 "default: Environment variable BB_SERVER_TIMEOUT.")
243 270
244 parser.add_argument("--no-setscene", action="store_true", 271 server_group.add_argument("--remote-server",
245 dest="nosetscene",
246 help="Do not run any setscene tasks. sstate will be ignored and "
247 "everything needed, built.")
248
249 parser.add_argument("--skip-setscene", action="store_true",
250 dest="skipsetscene",
251 help="Skip setscene tasks if they would be executed. Tasks previously "
252 "restored from sstate will be kept, unlike --no-setscene")
253
254 parser.add_argument("--setscene-only", action="store_true",
255 dest="setsceneonly",
256 help="Only run setscene tasks, don't run any real tasks.")
257
258 parser.add_argument("--remote-server",
259 default=os.environ.get("BBSERVER"), 272 default=os.environ.get("BBSERVER"),
260 help="Connect to the specified server.") 273 help="Connect to the specified server.")
261 274
262 parser.add_argument("-m", "--kill-server", action="store_true", 275 server_group.add_argument("-m", "--kill-server", action="store_true",
263 help="Terminate any running bitbake server.") 276 help="Terminate any running bitbake server.")
264 277
265 parser.add_argument("--observe-only", action="store_true", 278 server_group.add_argument("--token", dest="xmlrpctoken",
279 default=os.environ.get("BBTOKEN"),
280 help="Specify the connection token to be used when connecting "
281 "to a remote server.")
282
283 server_group.add_argument("--observe-only", action="store_true",
266 help="Connect to a server as an observing-only client.") 284 help="Connect to a server as an observing-only client.")
267 285
268 parser.add_argument("--status-only", action="store_true", 286 server_group.add_argument("--status-only", action="store_true",
269 help="Check the status of the remote bitbake server.") 287 help="Check the status of the remote bitbake server.")
270 288
271 parser.add_argument("-w", "--write-log", dest="writeeventlog", 289 server_group.add_argument("--server-only", action="store_true",
272 default=os.environ.get("BBEVENTLOG"), 290 help="Run bitbake without a UI, only starting a server "
273 help="Writes the event log of the build to a bitbake event json file. " 291 "(cooker) process.")
274 "Use '' (empty string) to assign the name automatically.")
275 292
276 parser.add_argument("--runall", action="append", default=[],
277 help="Run the specified task for any recipe in the taskgraph of the specified target (even if it wouldn't otherwise have run).")
278 293
279 parser.add_argument("--runonly", action="append", 294 config_group.add_argument("-r", "--read", action="append", dest="prefile", default=[],
280 help="Run only the specified task within the taskgraph of the specified targets (and any task dependencies those tasks may have).") 295 help="Read the specified file before bitbake.conf.")
296
297 config_group.add_argument("-R", "--postread", action="append", dest="postfile", default=[],
298 help="Read the specified file after bitbake.conf.")
299
281 300
282 parser.add_argument("targets", nargs="*", metavar="recipename/target", 301 config_group.add_argument("-I", "--ignore-deps", action="append",
283 help="Execute the specified task (default is 'build') for these target recipes (.bb files).") 302 dest="extra_assume_provided", default=[],
303 help="Assume these dependencies don't exist and are already provided "
304 "(equivalent to ASSUME_PROVIDED). Useful to make dependency "
305 "graphs more appealing.")
284 306
285 return parser 307 return parser
286 308