Use ASCII characters for tree formatting.
.TP
.BR \-J , " \-\-json"
-Use JSON output format.
+Use JSON output format. It's strongly recommended to use \fB\-\-output\fR and
+also \fB\-\-tree\fR if necessary.
.TP
.BR \-l , " \-\-list"
Produce output in the form of a list. The output does not provide information
.BR \-o , " \-\-output " \fIlist\fP
Specify which output columns to print. Use
.B \-\-help
-to get a list of all supported columns.
+to get a list of all supported columns. The columns may affect tree-like output.
+The default is to use tree for the column 'NAME' (see also \fB\-\-tree\fR).
The default list of columns may be extended if \fIlist\fP is
specified in the format \fI+list\fP (e.g. \fBlsblk -o +UUID\fP).
if (lsblk->dedup_hidden && lsblk->dedup_id == id)
fl |= SCOLS_FL_HIDDEN;
+ if (force_tree
+ && lsblk->flags & LSBLK_JSON
+ && has_tree_col == 0
+ && i + 1 == ncolumns)
+ /* The "--tree --json" specified, but no column with
+ * SCOLS_FL_TREE yet; force it for the last column
+ */
+ fl |= SCOLS_FL_TREE;
+
cl = scols_table_new_column(lsblk->table, ci->name, ci->whint, fl);
if (!cl) {
warn(_("failed to allocate output column"));