From aca72ac2f926174d4a690b4ddea5d54a05bbc720 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 28 Jun 2012 13:20:31 +0200 Subject: [PATCH] findmnt: don't use tree-like output if more -F options specified Signed-off-by: Karel Zak --- misc-utils/findmnt.8 | 8 +++++--- misc-utils/findmnt.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/misc-utils/findmnt.8 b/misc-utils/findmnt.8 index a31a967e4..69bae954f 100644 --- a/misc-utils/findmnt.8 +++ b/misc-utils/findmnt.8 @@ -47,7 +47,7 @@ The output is in the list format (see --list). .IP "\fB\-m, \-\-mtab\fP" Search in .IR /etc/mtab . -The output is in the list format (see --list). +The output is in the list format (see \fB\-\-list\fP). .IP "\fB\-k, \-\-kernel\fP" Search in .IR /proc/self/mountinfo . @@ -72,7 +72,8 @@ or Convert all tags (LABEL, UUID, PARTUUID or PARTLABEL) to the device names. .IP "\fB\-F, \-\-tab\-file \fIpath\fP" Search in an alternative file, if used with \fB\-\-fstab\fP, \fB\-\-mtab\fP -or \fB\-\-kernel\fP then overwrites the default paths. +or \fB\-\-kernel\fP then overwrites the default paths, if specified more than +once than tree-like output is disabled (see the \fB\-\-list\fP option). .IP "\fB\-f, \-\-first\-only\fP" Print the first matching filesystem only. .IP "\fB\-i, \-\-invert\fP" @@ -80,7 +81,8 @@ Invert the sense of matching. .IP "\fB\-l, \-\-list\fP" Use the list output format. This output format is automatically enabled if the output is restricted by \fB\-t\fP, \fB\-O\fP, \fB\-S\fP or \fB\-T\fP -option and the option \fB\-\-submounts\fP is not used. +option and the option \fB\-\-submounts\fP is not used or if more that one +source file (the option \fB\-F\fP) is specified. .IP "\fB\-v, \-\-nofsroot\fP" Do not print a [/dir] in the SOURCE column for bind-mounts or btrfs subvolumes. .IP "\fB\-n, \-\-noheadings\fP" diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index d7b252a8b..75f7eb761 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1280,7 +1280,7 @@ int main(int argc, char *argv[]) if (!tb) goto leave; - if ((tt_flags & TT_FL_TREE) && !tab_is_tree(tb)) + if ((tt_flags & TT_FL_TREE) && (ntabfiles > 1 || !tab_is_tree(tb))) tt_flags &= ~TT_FL_TREE; cache = mnt_new_cache();