tool: make result be aligned 58/262158/1 submit/tizen/20210805.103313
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 3 Aug 2021 06:25:14 +0000 (15:25 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Tue, 3 Aug 2021 06:26:06 +0000 (15:26 +0900)
Change-Id: Ic56d0f96b1337b00987e04c3092e7d4ad96fd2e6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
tool/system-info-tool-get.c

index a448a12b86ac685614d896e3ddfbe6064a96cfb2..5fb7d9c7a3ee7415f45a778241627dfde716ee21 100644 (file)
@@ -18,20 +18,21 @@ void system_info_tool_get_help(void)
 static void print_dbentry(struct dbentry *dbentry, bool found)
 {
        const struct db *db;
+       char prefix[BUFFER_MAX];
 
        if (!dbentry || !dbentry->db)
                return;
 
        db = dbentry->db;
 
+       snprintf(prefix, sizeof(prefix), "%s Key (%c)", db->name, db->ticker);
+       printf("%21s: ", prefix);
+
        if (found) {
-               printf("%s Key (%c) found: ", db->name, db->ticker);
+               print_value(dbentry->value);
        } else {
-               printf("%s Key (%c) not found\n", db->name, db->ticker);
-               return;
+               printf("not found\n");
        }
-
-       print_value(dbentry->value);
 }
 
 int system_info_tool_get_raw(const char *searchkey, system_info_type_e searchtype,