[Zucchini] Add command line processing framework with stubs.
This CL adds main_utils.*, which has the framework to dispatch Zucchini commands and print help messages. This is used by the Zucchini main program, and is not part of Zucchini library. - Add ::Command: A struct containing command name (e.g., "-gen", "-apply"), help message, and a base::Callback containing code for the main command. This allows Zucchini command dispatch without bulky bulky class hierarchy and superfluous instantialization. - Add ::CommandRegistry: A class to manage ::Command instances and dispatch commands, or print help messages. - Add ::ResourceUsageTracker: A class instantiated in main() to track resource usage for valid command invocations, and and print them at end. Specifically: - Zucchini.PeakPagefileUsage (KiB) - Zucchini.PeakWorkingSetSize (KiB) - Zucchini.TotalTime (s) Also add "-quiet" switch to disable this. - Add stubs for Zucchini-gen and Zucchini-apply, to be populated later. - Starting to use LOG(INFO) to display output. This requires updating PRESUBMIT.py to add Zucchini as an exception. Bug: 729154 Change-Id: Id5263435100dc73b2d8917ca2bcd04245ed41934 Reviewed-on: https://chromium-review.googlesource.com/567492 Commit-Queue: Samuel Huang <huangs@chromium.org> Reviewed-by:Dirk Pranke <dpranke@chromium.org> Cr-Commit-Position: refs/heads/master@{#486762}
Showing
Please register or sign in to comment