SkFlags now follows proper dashing convention.
Two dashes are used for flags with multiple characters, and one
dash is used for flags with single characters.
In GM, changed '-wp' to '-p' (the command to choose a directory
for writing SKPs) to fit with the convention.
In render_pictures and bench_pictures, changed the flag for
read and write path to have full names (which are consistent)
and use the old single character names as their shortcuts.
SkCommandLineFlags: Updated the documentation, and only allow
-h or --help for help (again, to match the convention).
Also enforce the single character limit for the short name, and
require the full name to be at least two characters.
Provide full names for skhello.
BUG=https://code.google.com/p/skia/issues/detail?id=1174
Review URL: https://codereview.chromium.org/12521019
git-svn-id: http://skia.googlecode.com/svn/trunk@8582 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp
index 81fb96c..736e826 100644
--- a/tools/render_pictures_main.cpp
+++ b/tools/render_pictures_main.cpp
@@ -27,8 +27,8 @@
DEFINE_int32(maxComponentDiff, 256, "Maximum diff on a component, 0 - 256. Components that differ "
"by more than this amount are considered errors, though all diffs are reported. "
"Requires --validate.");
-DECLARE_string(r);
-DEFINE_string(w, "", "Directory to write the rendered images.");
+DECLARE_string(readPath);
+DEFINE_string2(writePath, w, "", "Directory to write the rendered images.");
DEFINE_bool(writeWholeImage, false, "In tile mode, write the entire rendered image to a "
"file, instead of an image for each tile.");
DEFINE_bool(validate, false, "Verify that the rendered image contains the same pixels as "
@@ -277,7 +277,7 @@
SkCommandLineFlags::SetUsage("Render .skp files.");
SkCommandLineFlags::Parse(argc, argv);
- if (FLAGS_r.isEmpty()) {
+ if (FLAGS_readPath.isEmpty()) {
SkDebugf(".skp files or directories are required.\n");
exit(-1);
}
@@ -311,13 +311,13 @@
SkAutoGraphics ag;
SkString outputDir;
- if (FLAGS_w.count() == 1) {
- outputDir.set(FLAGS_w[0]);
+ if (FLAGS_writePath.count() == 1) {
+ outputDir.set(FLAGS_writePath[0]);
}
int failures = 0;
- for (int i = 0; i < FLAGS_r.count(); i ++) {
- failures += process_input(FLAGS_r[i], &outputDir, *renderer.get());
+ for (int i = 0; i < FLAGS_readPath.count(); i ++) {
+ failures += process_input(FLAGS_readPath[i], &outputDir, *renderer.get());
}
if (failures != 0) {
SkDebugf("Failed to render %i pictures.\n", failures);