]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_info: Fix -H with -c
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 30 Jan 2014 17:25:21 +0000 (17:25 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 31 Jan 2014 10:34:43 +0000 (10:34 +0000)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_info.c

index 7915c0e3ed30a8d039b0fb85013645ea2337efb7..4243cf3ecfa37c99e5a31af94b0cf869ca55cd63 100644 (file)
@@ -338,11 +338,17 @@ static int print_info(const char *name, const char *lxcpath)
                        if (c->get_config_item(c, key[i], val, len + 1) != len) {
                                fprintf(stderr, "unable to read %s from configuration\n", key[i]);
                        } else {
-                               printf("%s = %s\n", key[i], val);
+                               if (!humanize && keys == 1)
+                                       printf("%s\n", val);
+                               else
+                                       printf("%s = %s\n", key[i], val);
                        }
                        free(val);
                } else if (len == 0) {
-                       printf("%s =\n", key[i]);
+                       if (!humanize && keys == 1)
+                               printf("\n");
+                       else
+                               printf("%s =\n", key[i]);
                } else {
                        fprintf(stderr, "%s invalid\n", key[i]);
                }