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)
downloadrockbox-7da2df4b4bf94c31bef809a64e94b7db516c60d7.tar.gz
rockbox-7da2df4b4bf94c31bef809a64e94b7db516c60d7.zip
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)
191 191
192 struct wps_data wps; 192 struct wps_data wps;
193 193
194 if (argc < 2) { 194 /* No arguments -> print the help text
195 printf("Usage: checkwps [OPTIONS] filename.wps\n"); 195 * Also print the help text upon -h or --help */
196 if( (argc < 2) ||
197 strcmp(argv[1],"-h") == 0 ||
198 strcmp(argv[1],"--help") == 0 )
199 {
200 printf("Usage: checkwps [OPTIONS] filename.wps [filename2.wps]...\n");
196 printf("\nOPTIONS:\n"); 201 printf("\nOPTIONS:\n");
197 printf("\t-v\tverbose\n"); 202 printf("\t-v\t\tverbose\n");
198 printf("\t-vv\tmore verbose\n"); 203 printf("\t-vv\t\tmore verbose\n");
199 printf("\t-vvv\tvery verbose\n"); 204 printf("\t-vvv\t\tvery verbose\n");
205 printf("\t-h,\t--help\tshow this message\n");
200 return 1; 206 return 1;
201 } 207 }
202 208
@@ -216,6 +222,10 @@ int main(int argc, char **argv)
216 } 222 }
217 close(fd); 223 close(fd);
218 224
225 /* Go through every wps that was thrown at us, error out at the first
226 * flawed wps */
227 while (argv[filearg]) {
228 printf("Checking %s...\n", argv[filearg]);
219 res = wps_data_load(&wps, &screens[0], argv[filearg], true); 229 res = wps_data_load(&wps, &screens[0], argv[filearg], true);
220 230
221 if (!res) { 231 if (!res) {
@@ -223,7 +233,9 @@ int main(int argc, char **argv)
223 return 3; 233 return 3;
224 } 234 }
225 235
226 printf("WPS parsed OK\n"); 236 printf("WPS parsed OK\n\n");
237 filearg++;
238 }
227 return 0; 239 return 0;
228} 240}
229 241