fputs(_(" -F, --tab-file <path> alternative file for -s, -m or -k options\n"), out);
fputs(_(" -m, --mtab search in table of mounted filesystems\n"
" (includes user space mount options)\n"), out);
- fputs(_(" -k, --kernel[=<method>] search in kernel mount table (default)\n"
+ fputs(_(" -k alias to '--kernel mountinfo'\n"), out);
+ fputs(_(" --kernel[=<method>] search in kernel mount table (default)\n"
" <method> is mountinfo or listmount\n"), out);
fputs(_(" -N, --task <tid> use alternative namespace (/proc/<tid>/mountinfo file)\n"), out);
fputs(_(" -p, --poll[=<list>] monitor changes in table of mounted filesystems\n"), out);
FINDMNT_OPT_SHADOWED,
FINDMNT_OPT_HYPERLINK,
FINDMNT_OPT_ID,
- FINDMNT_OPT_UNIQ_ID
+ FINDMNT_OPT_UNIQ_ID,
+ FINDMNT_OPT_KERNEL
};
static const struct option longopts[] = {
{ "help", no_argument, NULL, 'h' },
{ "invert", no_argument, NULL, 'i' },
{ "json", no_argument, NULL, 'J' },
- { "kernel", optional_argument, NULL, 'k' },
+ { "kernel", optional_argument, NULL, FINDMNT_OPT_KERNEL },
{ "list", no_argument, NULL, 'l' },
{ "mountpoint", required_argument, NULL, 'M' },
{ "mtab", no_argument, NULL, 'm' },
findmnt.flags |= FL_TREE;
while ((c = getopt_long(argc, argv,
- "AabCcDd:ehIiJfF:o:O:p::PQ:k::lmM:nN:rst:uvRS:T:Uw:VxyH",
+ "AabCcDd:ehIiJfF:o:O:p::PQ:klmM:nN:rst:uvRS:T:Uw:VxyH",
longopts, NULL)) != -1) {
err_exclusive_options(c, longopts, excl, excl_st);
findmnt.flags &= ~FL_TREE;
break;
case 'k':
+ tabtype = TABTYPE_KERNEL_MOUNTINFO;
+ break;
+ case FINDMNT_OPT_KERNEL:
if (optarg) {
if (strcmp(optarg, "mountinfo") == 0)
tabtype = TABTYPE_KERNEL_MOUNTINFO;