-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
servoshell: Update the debug options (-Z) help to reflect current set of options
#39316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0f54ded to
aa8f712
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
components/config/opts.rs
Outdated
| //! from command line arguments. | ||
| use std::default::Default; | ||
| use std::fmt::Debug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be used anywhere. Is this needed?
components/config/opts.rs
Outdated
| pub fn print_help(app: &str) { | ||
| fn print_option(name: &str, description: &str) { | ||
| println!("\t{:<35} {}", name, description); | ||
| } | ||
| println!( | ||
| "Usage: {} debug option,[options,...]\n\twhere options include\n\nOptions:", | ||
| app | ||
| ); | ||
| print_option( | ||
| "convert-mouse-to-touch", | ||
| "Send touch events instead of mouse events", | ||
| ); | ||
| print_option( | ||
| "disable-share-style-cache", | ||
| "Disable the style sharing cache.", | ||
| ); | ||
| print_option( | ||
| "dump-display-list", | ||
| "Print the display list after each layout.", | ||
| ); | ||
| print_option( | ||
| "dump-stacking-context-tree", | ||
| "Print the stacking context tree after each layout.", | ||
| ); | ||
| print_option( | ||
| "dump-flow-tree", | ||
| "Print the fragment tree after each layout.", | ||
| ); | ||
| print_option( | ||
| "dump-rule-tree", | ||
| "Print the style rule tree after each layout.", | ||
| ); | ||
| print_option( | ||
| "dump-style-tree", | ||
| "Print the DOM with computed styles after each restyle.", | ||
| ); | ||
| print_option("dump-style-stats", "Print style stats after each restyle."); | ||
| print_option("dump-scroll-tree", "Print scroll tree after each layout."); | ||
| print_option("gc-profile", "Log GC passes and their durations."); | ||
| print_option( | ||
| "profile-script-events", | ||
| "Enable profiling of script-related events.", | ||
| ); | ||
| print_option( | ||
| "relayout-event", | ||
| "Print notifications when there is a relayout.", | ||
| ); | ||
| print_option( | ||
| "signpost", | ||
| "Emit native OS signposts for profile events (currently macOS only)", | ||
| ); | ||
| print_option( | ||
| "trace-layout", | ||
| "Write layout trace to an external file for debugging.", | ||
| ); | ||
| print_option("wr-stats", "Show WebRender profiler on screen."); | ||
|
|
||
| println!(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved to servoshell as Opts doesn't handle command-line arguments and thus shouldn't be responsible for dumping help output for them. I think it makes sense to keep this in servoshell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the problem is that it will always be out of sync if it is not close. I think if we really want to keep it in servo she'll, I can at least add a comment to the DebugOptions struct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They shouldn't be out of sync for long, as I have plans to integrate these options into the Servo API via a ServoLoggingSettings struct that will have parsing capability as well. Once that happens this code will likely go away. For the moment, I think it's better to keep all of the command-line parsing and help code together though.
@Narfinger I'm happy to do this as you are on vacation now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok that makes sense.
Feel free to do it.
-Z) help to reflect current set of options
8b23ca5 to
52cad52
Compare
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
52cad52 to
d3ca7c3
Compare
The command-line help output for
-Zand `DebugOptions were out of sync again. This change makes sure they match again.Testing: No tests necessary as this mainly just updates the help output.
Fixes: #39311