diff options
author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-07-22 17:17:53 +0000 |
---|---|---|
committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2007-07-22 17:17:53 +0000 |
commit | 3213d4a0f5d3aea725bb9ddf34ae0ec38ca4b097 (patch) | |
tree | a7e386aef4624f453201aca9b5bf5ca8b38c3fd2 /tools/checkwps.c | |
parent | c897c241d9f085c8a8288183b62b3ea1d9e1796f (diff) | |
download | rockbox-3213d4a0f5d3aea725bb9ddf34ae0ec38ca4b097.tar.gz rockbox-3213d4a0f5d3aea725bb9ddf34ae0ec38ca4b097.zip |
Add a verbosity level command line option to the chackwps tool. This should make life easier for the themes.rockbox.org people.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13958 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/checkwps.c')
-rw-r--r-- | tools/checkwps.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tools/checkwps.c b/tools/checkwps.c index 74ce1e82be..950c341bfc 100644 --- a/tools/checkwps.c +++ b/tools/checkwps.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) | 5 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) |
6 | 6 | ||
7 | bool debug_wps = true; | 7 | bool debug_wps = true; |
8 | int wps_verbose_level = 0; | ||
8 | 9 | ||
9 | int read_bmp_file(char* filename, | 10 | int read_bmp_file(char* filename, |
10 | struct bitmap *bm, | 11 | struct bitmap *bm, |
@@ -63,22 +64,36 @@ int main(int argc, char **argv) | |||
63 | { | 64 | { |
64 | int res; | 65 | int res; |
65 | int fd; | 66 | int fd; |
67 | int filearg = 1; | ||
66 | 68 | ||
67 | struct wps_data wps; | 69 | struct wps_data wps; |
68 | 70 | ||
69 | if (argc != 2) { | 71 | if (argc < 2) { |
70 | printf("Usage: checkwps filename.wps\n"); | 72 | printf("Usage: checkwps [OPTIONS] filename.wps\n"); |
73 | printf("\nOPTIONS:\n"); | ||
74 | printf("\t-v\tverbose\n"); | ||
75 | printf("\t-vv\tmore verbose\n"); | ||
76 | printf("\t-vvv\tvery verbose\n"); | ||
71 | return 1; | 77 | return 1; |
72 | } | 78 | } |
73 | 79 | ||
74 | fd = open(argv[1], O_RDONLY); | 80 | if (argv[1][0] == '-') { |
81 | filearg++; | ||
82 | int i = 1; | ||
83 | while (argv[1][i] && argv[1][i] == 'v') { | ||
84 | i++; | ||
85 | wps_verbose_level++; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | fd = open(argv[filearg], O_RDONLY); | ||
75 | if (fd < 0) { | 90 | if (fd < 0) { |
76 | printf("Failed to open %s\n",argv[1]); | 91 | printf("Failed to open %s\n",argv[1]); |
77 | return 2; | 92 | return 2; |
78 | } | 93 | } |
79 | close(fd); | 94 | close(fd); |
80 | 95 | ||
81 | res = wps_data_load(&wps, argv[1], true); | 96 | res = wps_data_load(&wps, argv[filearg], true); |
82 | 97 | ||
83 | if (!res) { | 98 | if (!res) { |
84 | printf("WPS parsing failure\n"); | 99 | printf("WPS parsing failure\n"); |