findmnt: don't use tree-like output if more -F options specified

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-06-28 13:20:31 +02:00
parent 8b8cd87b21
commit aca72ac2f9
2 changed files with 6 additions and 4 deletions

View File

@ -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"

View File

@ -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();