char *type = NULL;
char *device = NULL; /* pointer to argv[], ie: /dev/sda1 */
char *wholedisk = NULL; /* allocated, ie: /dev/sda */
+ char *outarg = NULL;
dev_t disk_devno = 0, part_devno = 0;
static const struct option long_opts[] = {
errx(EXIT_FAILURE, _("failed to parse --nr <M-N> range"));
break;
case 'o':
- ncolumns = string_to_idarray(optarg,
- columns, ARRAY_SIZE(columns),
- column_name_to_id);
- if (ncolumns < 0)
- return EXIT_FAILURE;
+ outarg = optarg;
break;
case 'P':
tt_flags |= TT_FL_EXPORT;
columns[ncolumns++] = COL_UUID;
}
+ if (what == ACT_SHOW && outarg &&
+ string_add_to_idarray(outarg, columns, ARRAY_SIZE(columns),
+ &ncolumns, column_name_to_id) < 0)
+ return EXIT_FAILURE;
+
/*
* Note that 'partx /dev/sda1' == 'partx /dev/sda1 /dev/sda'
* so assume that the device and/or disk are always the last