diff options
| author | 2010-01-22 12:47:35 +0100 | |
|---|---|---|
| committer | 2010-01-22 12:47:35 +0100 | |
| commit | e6b08f71f9ebf06541551f49a3ecda324918e440 (patch) | |
| tree | ca672fefeb729100d68e1c5c11d09267a858f5d0 /tools/iphoneinfo.c | |
| parent | f725355489c4a203012ba74a58483945772e6578 (diff) | |
| download | libimobiledevice-e6b08f71f9ebf06541551f49a3ecda324918e440.tar.gz libimobiledevice-e6b08f71f9ebf06541551f49a3ecda324918e440.tar.bz2 | |
Indent output of iphoneinfo in key/value mode
Diffstat (limited to 'tools/iphoneinfo.c')
| -rw-r--r-- | tools/iphoneinfo.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/iphoneinfo.c b/tools/iphoneinfo.c index 7c41033..acb62f7 100644 --- a/tools/iphoneinfo.c +++ b/tools/iphoneinfo.c | |||
| @@ -55,6 +55,8 @@ static const char *domains[] = { | |||
| 55 | NULL | 55 | NULL |
| 56 | }; | 56 | }; |
| 57 | 57 | ||
| 58 | static int indent_level = 0; | ||
| 59 | |||
| 58 | int is_domain_known(char *domain); | 60 | int is_domain_known(char *domain); |
| 59 | void print_usage(int argc, char **argv); | 61 | void print_usage(int argc, char **argv); |
| 60 | void plist_node_to_string(plist_t node); | 62 | void plist_node_to_string(plist_t node); |
| @@ -265,7 +267,9 @@ void plist_node_to_string(plist_t node) | |||
| 265 | case PLIST_ARRAY: | 267 | case PLIST_ARRAY: |
| 266 | case PLIST_DICT: | 268 | case PLIST_DICT: |
| 267 | printf("\n"); | 269 | printf("\n"); |
| 270 | indent_level++; | ||
| 268 | plist_children_to_string(node); | 271 | plist_children_to_string(node); |
| 272 | indent_level--; | ||
| 269 | break; | 273 | break; |
| 270 | default: | 274 | default: |
| 271 | break; | 275 | break; |
| @@ -283,6 +287,7 @@ void plist_children_to_string(plist_t node) | |||
| 283 | plist_dict_next_item(node, it, &key, &subnode); | 287 | plist_dict_next_item(node, it, &key, &subnode); |
| 284 | while (subnode) | 288 | while (subnode) |
| 285 | { | 289 | { |
| 290 | printf("%*s", indent_level, ""); | ||
| 286 | printf("%s: ", key); | 291 | printf("%s: ", key); |
| 287 | free(key); | 292 | free(key); |
| 288 | key = NULL; | 293 | key = NULL; |
