summaryrefslogtreecommitdiffstats
path: root/text-utils/column.c
diff options
context:
space:
mode:
authorKarel Zak2017-04-19 13:22:31 +0200
committerKarel Zak2017-05-02 12:18:00 +0200
commit74cc7c2515b15d285700204d55388a3d7d8a2ca4 (patch)
treefa28d722d13dba63b5e9db94d4774f4ad98f386e /text-utils/column.c
parenttests: add tests for new column features (diff)
downloadkernel-qcow2-util-linux-74cc7c2515b15d285700204d55388a3d7d8a2ca4.tar.gz
kernel-qcow2-util-linux-74cc7c2515b15d285700204d55388a3d7d8a2ca4.tar.xz
kernel-qcow2-util-linux-74cc7c2515b15d285700204d55388a3d7d8a2ca4.zip
column: parent and child has to be independent
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'text-utils/column.c')
-rw-r--r--text-utils/column.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-utils/column.c b/text-utils/column.c
index c22de90ce..707086244 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -329,7 +329,7 @@ static void create_tree(struct column_control *ctl)
if (!parent)
continue;
- if (strcmp(id, parent) == 0)
+ if (strcmp(id, parent) == 0 && ln_i != ln)
scols_line_add_child(ln_i, ln);
}
}
@@ -556,7 +556,7 @@ static void __attribute__((__noreturn__)) usage(int rc)
fputs(_(" -W, --table-wrap <columns> wrap text in the columns when necessary\n"), out);
fputs(_(" -J, --json use JSON output format for table\n"), out);
- fputs(USAGE_OPTIONS, out);
+ fputs(USAGE_SEPARATOR, out);
fputs(_(" -r, --tree <column> column to use tree-like output for the table\n"), out);
fputs(_(" -i, --tree-id <column> line ID to specify child-parent relation\n"), out);
fputs(_(" -p, --tree-parent <column> parent to specify child-parent relation\n"), out);