if (devno) {
char *tmp;
int rc = 0;
- if (tt_flags & TT_FL_RAW)
+ if ((tt_flags & TT_FL_RAW) || (tt_flags & TT_FL_EXPORT))
rc = asprintf(&tmp, "%u:%u",
major(devno), minor(devno));
else
" -u, --notruncate don't truncate text in columns\n"
" -O, --options <list> limit the set of filesystems by mount options\n"
" -o, --output <list> output columns\n"
- " -r, --raw use raw format output\n"
+ " -P, --pairs use key=\"value\" output format\n"
+ " -r, --raw use raw output format\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"
{ "options", 1, 0, 'O' },
{ "output", 1, 0, 'o' },
{ "poll", 2, 0, 'p' },
+ { "pairs", 0, 0, 'P' },
{ "raw", 0, 0, 'r' },
{ "types", 1, 0, 't' },
{ "fsroot", 0, 0, 'v' },
tt_flags |= TT_FL_TREE;
while ((c = getopt_long(argc, argv,
- "acd:ehifo:O:p::klmnrst:uvRS:T:w:", longopts, NULL)) != -1) {
+ "acd:ehifo:O:p::Pklmnrst:uvRS:T:w:", longopts, NULL)) != -1) {
switch(c) {
case 'a':
tt_flags |= TT_FL_ASCII;
flags |= FL_POLL;
tt_flags &= ~TT_FL_TREE;
break;
+ case 'P':
+ tt_flags |= TT_FL_EXPORT;
+ tt_flags &= ~TT_FL_TREE;
+ break;
case 'm': /* mtab */
if (tabfile)
errx_mutually_exclusive("--{fstab,mtab,kernel}");
tt_flags |= TT_FL_RAW; /* enable raw */
break;
case 'l':
- if (tt_flags & TT_FL_RAW)
- errx_mutually_exclusive("--{raw,list}");
+ if ((tt_flags & TT_FL_RAW) && (tt_flags & TT_FL_EXPORT))
+ errx_mutually_exclusive("--{raw,list,pairs}");
tt_flags &= ~TT_FL_TREE; /* disable the default */
break;