bevy_mod_debugdump icon indicating copy to clipboard operation
bevy_mod_debugdump copied to clipboard

Allow dumping any schedule from the CLI.

Open andriyDev opened this issue 1 year ago • 1 comments
trafficstars

Previously, we could only dump the Update schedule from the CLI. Now we can do any schedule.

To make this happen, I also redesigned the CLI slightly. Instead of having flags for each command (--dump-render, --dump-update-schedule), I switched them to look like commands. So now users can do cargo r -- dump-render render.dot or cargo r -- dump-schedule Update update.dot. However this does mean we can't do both at the same time. This seems like a reasonable approach though and makes it easier to extend. For example we can have flags that are only available in specific commands (e.g., filter by system set should only be a valid flag if you're running the dump-schedule command).

In a future PR, I think we can also extend this to support sub-apps with an additional flag to the dump-schedule command.

andriyDev avatar Aug 10 '24 21:08 andriyDev

@jakobhellermann is there anything other changes I should make here?

andriyDev avatar Aug 18 '24 19:08 andriyDev

@jakobhellermann is there anything other changes I should make here?

sorry no, it was pretty much good to go, I just forgot about it. I've merged it to main now, with one change to the cli: It's now

cargo run -- dump-schedule Update | dot -Tsvg out.svg
cargo run --dump-schedule Update -o out.dot

i.e. by default it prints to stdout, and you can pass -o or --output to write to a file.

jakobhellermann avatar Nov 30 '24 13:11 jakobhellermann