summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-30 15:49:53 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-07-30 15:49:53 +0000
commit7da2df4b4bf94c31bef809a64e94b7db516c60d7 (patch)
treecbcee1ed4959ddeeabde6795dc15237a5535dd3c
parent49d378b0f6da7379f05cc0dbec77b452da52f051 (diff)
Commit FS#9012 thanks to Thomas Martitz
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18153 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--tools/checkwps/checkwps.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c
index 9eaee6e121..2981303701 100644
--- a/tools/checkwps/checkwps.c
+++ b/tools/checkwps/checkwps.c
@@ -191,12 +191,18 @@ int main(int argc, char **argv)
struct wps_data wps;
- if (argc < 2) {
- printf("Usage: checkwps [OPTIONS] filename.wps\n");
+ /* No arguments -> print the help text
+ * Also print the help text upon -h or --help */
+ if( (argc < 2) ||
+ strcmp(argv[1],"-h") == 0 ||
+ strcmp(argv[1],"--help") == 0 )
+ {
+ printf("Usage: checkwps [OPTIONS] filename.wps [filename2.wps]...\n");
printf("\nOPTIONS:\n");
- printf("\t-v\tverbose\n");
- printf("\t-vv\tmore verbose\n");
- printf("\t-vvv\tvery verbose\n");
+ printf("\t-v\t\tverbose\n");
+ printf("\t-vv\t\tmore verbose\n");
+ printf("\t-vvv\t\tvery verbose\n");
+ printf("\t-h,\t--help\tshow this message\n");
return 1;
}
@@ -216,6 +222,10 @@ int main(int argc, char **argv)
}
close(fd);
+ /* Go through every wps that was thrown at us, error out at the first
+ * flawed wps */
+ while (argv[filearg]) {
+ printf("Checking %s...\n", argv[filearg]);
res = wps_data_load(&wps, &screens[0], argv[filearg], true);
if (!res) {
@@ -223,7 +233,9 @@ int main(int argc, char **argv)
return 3;
}
- printf("WPS parsed OK\n");
+ printf("WPS parsed OK\n\n");
+ filearg++;
+ }
return 0;
}