summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-01-22 12:47:35 +0100
committerGravatar Martin Szulecki2010-01-22 12:47:35 +0100
commite6b08f71f9ebf06541551f49a3ecda324918e440 (patch)
treeca672fefeb729100d68e1c5c11d09267a858f5d0 /tools
parentf725355489c4a203012ba74a58483945772e6578 (diff)
downloadlibimobiledevice-e6b08f71f9ebf06541551f49a3ecda324918e440.tar.gz
libimobiledevice-e6b08f71f9ebf06541551f49a3ecda324918e440.tar.bz2
Indent output of iphoneinfo in key/value mode
Diffstat (limited to 'tools')
-rw-r--r--tools/iphoneinfo.c5
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
58static int indent_level = 0;
59
58int is_domain_known(char *domain); 60int is_domain_known(char *domain);
59void print_usage(int argc, char **argv); 61void print_usage(int argc, char **argv);
60void plist_node_to_string(plist_t node); 62void 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;