Invert the sense of matching.
.IP "\fB\-l, \-\-list\fP"
Use the list output format.
+.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"
Do not print a header line.
.IP "\fB\-u, \-\-notruncate\fP"
FL_FIRSTONLY = (1 << 3),
FL_INVERT = (1 << 4),
FL_NOSWAPMATCH = (1 << 6),
+ FL_NOFSROOT = (1 << 7),
};
/* column IDs */
switch(get_column_id(num)) {
case COL_SOURCE:
- /* dir or dev */
+ {
+ const char *root = mnt_fs_get_root(fs);
+
str = mnt_fs_get_srcpath(fs);
if (str && (flags & FL_CANONICALIZE))
if (str && (flags & FL_EVALUATE))
str = mnt_resolve_spec(str, cache);
}
+ if (root && str && !(flags & FL_NOFSROOT) && strcmp(root, "/")) {
+ char *tmp;
+
+ if (asprintf(&tmp, "%s[%s]", str, root) > 0)
+ str = tmp;
+ }
break;
+ }
case COL_TARGET:
str = mnt_fs_get_target(fs);
break;
" -r, --raw use raw format output\n"
" -a, --ascii use ascii chars for tree formatting\n"
" -t, --types <list> limit the set of filesystem by FS types\n"
+ " -v, --nofsroot don't print [/dir] for bind or btrfs mounts\n"
" -S, --source <string> device, LABEL= or UUID=device\n"
" -T, --target <string> mountpoint\n\n"));
{ "output", 1, 0, 'o' },
{ "raw", 0, 0, 'r' },
{ "types", 1, 0, 't' },
+ { "fsroot", 0, 0, 'v' },
{ "source", 1, 0, 'S' },
{ "target", 1, 0, 'T' },
tt_flags |= TT_FL_TREE;
while ((c = getopt_long(argc, argv,
- "acd:ehifo:O:klmnrst:uS:T:", longopts, NULL)) != -1) {
+ "acd:ehifo:O:klmnrst:uvS:T:", longopts, NULL)) != -1) {
switch(c) {
case 'a':
tt_flags |= TT_FL_ASCII;
case 'n':
tt_flags |= TT_FL_NOHEADINGS;
break;
+ case 'v':
+ flags |= FL_NOFSROOT;
+ break;
case 'S':
set_match(COL_SOURCE, optarg);
flags |= FL_NOSWAPMATCH;
tt_flags &= ~TT_FL_TREE;
}
}
+
if (optind < argc && (get_match(COL_SOURCE) || get_match(COL_TARGET)))
errx(EXIT_FAILURE, _(
"options --target and --source can't be used together "