.IP "\fB\-h, \-\-help\fP"
Print a help text and exit.
.IP "\fB\-i, \-\-ascii\fP"
-Use ascii characters for tree formatting.
+Use ASCII characters for tree formatting.
.IP "\fB\-m, \-\-perms\fP
Output info about device owner, group and mode. This option is equivalent to "-o NAME,SIZE,OWNER,GROUP,MODE".
.IP "\fB\-l, \-\-list\fP"
Specify which output columns to print. Use
.B "--help"
to get a list of all supported columns.
+.IP "\fB\-P, \-\-pairs\fP"
+Use key="value" output format.
.IP "\fB\-r, \-\-raw\fP"
Use the raw output format.
.IP "\fB\-t, \-\-topology\fP"
break;
}
case COL_MAJMIN:
- if (lsblk->tt->flags & TT_FL_RAW)
+ if ((lsblk->tt->flags & TT_FL_RAW) ||
+ (lsblk->tt->flags & TT_FL_EXPORT))
snprintf(buf, sizeof(buf), "%u:%u", cxt->maj, cxt->min);
else
snprintf(buf, sizeof(buf), "%3u:%-3u", cxt->maj, cxt->min);
" -l, --list use list format ouput\n"
" -n, --noheadings don't print headings\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"
" -t, --topology output info about topology\n"));
fprintf(out, _("\nAvailable columns:\n"));
{ "fs", 0, 0, 'f' },
{ "exclude", 1, 0, 'e' },
{ "topology", 0, 0, 't' },
+ { "pairs", 0, 0, 'P' },
{ NULL, 0, 0, 0 },
};
lsblk = &_ls;
memset(lsblk, 0, sizeof(*lsblk));
- while((c = getopt_long(argc, argv, "abdDe:fhlnmo:irt", longopts, NULL)) != -1) {
+ while((c = getopt_long(argc, argv, "abdDe:fhlnmo:Pirt", longopts, NULL)) != -1) {
switch(c) {
case 'a':
lsblk->all_devices = 1;
help(stdout);
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,export}");
tt_flags &= ~TT_FL_TREE; /* disable the default */
break;
column_name_to_id))
return EXIT_FAILURE;
break;
+ case 'P':
+ tt_flags |= TT_FL_EXPORT;
+ tt_flags &= ~TT_FL_TREE; /* disable the default */
+ break;
case 'i':
tt_flags |= TT_FL_ASCII;
break;