Commit 44fa8e7e by Stéphane Graber

lxc_info: Fix -H with -c

parent 58ab99ae
...@@ -338,10 +338,16 @@ static int print_info(const char *name, const char *lxcpath) ...@@ -338,10 +338,16 @@ static int print_info(const char *name, const char *lxcpath)
if (c->get_config_item(c, key[i], val, len + 1) != len) { if (c->get_config_item(c, key[i], val, len + 1) != len) {
fprintf(stderr, "unable to read %s from configuration\n", key[i]); fprintf(stderr, "unable to read %s from configuration\n", key[i]);
} else { } else {
if (!humanize && keys == 1)
printf("%s\n", val);
else
printf("%s = %s\n", key[i], val); printf("%s = %s\n", key[i], val);
} }
free(val); free(val);
} else if (len == 0) { } else if (len == 0) {
if (!humanize && keys == 1)
printf("\n");
else
printf("%s =\n", key[i]); printf("%s =\n", key[i]);
} else { } else {
fprintf(stderr, "%s invalid\n", key[i]); fprintf(stderr, "%s invalid\n", key[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment