ashb opened a new pull request #15970:
URL: https://github.com/apache/airflow/pull/15970
The prepare_usage command was being called and setting variables to produce
the full usage text for all commands at start up -- and while this isn't a
problem for speed, it makes the output when running with `bash
-x`/`VERBOSE_COMMANDS` a **lot** longer.
This change delays creating the usage variables and formatted versions until
they are needed.
Net result when running this command:
```sh
bash -c 'exec 5>breeze-trace.log; export BASH_XTRACEFD=5;
VERBOSE_COMMANDS=true VERBOSE=true ./breeze -n shell -- -c "true"'
```
Before 4500 lines, 204K of "trace" logs
```
❯ wc -lc breeze-trace.log
4528 204088 breeze-trace.log
```
After is 1/4 as much output:
```
❯ wc -lc breeze-trace-with-change.log
1402 68167 breeze-trace-with-change.log
```
This PR has no functional impact on the breeze script (I tested `flags`,
`help`, `help-all` and `--help` on subcommands, all produce the same output)
but makes it easier to debug breeze commands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]