line = scols_table_new_line(table, NULL);
if (!line) {
- warn(_("failed to add line to output"));
+ warn(_("failed to allocate output line"));
return -ENOMEM;
}
else if (str)
rc = scols_line_refer_data(line, i, str);
if (rc) {
- warn(_("failed to add data to output table"));
+ warn(_("failed to add output data"));
break;
}
}
scols_init_debug(0);
table = scols_new_table();
if (!table) {
- warn(_("failed to initialize output table"));
+ warn(_("failed to allocate output table"));
return -1;
}
scols_table_enable_raw(table, !!(scols_flags & PARTX_RAW));
struct colinfo *col = get_column_info(i);
if (!scols_table_new_column(table, col->name, col->whint, col->flags)) {
- warnx(_("failed to initialize output column"));
+ warnx(_("failed to allocate output column"));
goto done;
}
}
fputs(_(" -P, --pairs use key=\"value\" output format\n"), out);
fputs(_(" -r, --raw use raw output format\n"), out);
fputs(_(" -S, --sector-size <num> overwrite sector size\n"), out);
- fputs(_(" -t, --type <type> specify the partition type (dos, bsd, solaris, etc.)\n"), out);
+ fputs(_(" -t, --type <type> specify the partition type\n"), out);
+ fputs(_(" --list-types list supported partition types and exit\n"), out);
fputs(_(" -v, --verbose verbose mode\n"), out);
fputs(USAGE_SEPARATOR, out);
dev_t disk_devno = 0, part_devno = 0;
unsigned int sector_size = 0;
+ enum {
+ OPT_LIST_TYPES = CHAR_MAX + 1
+ };
static const struct option long_opts[] = {
{ "bytes", no_argument, NULL, 'b' },
{ "noheadings", no_argument, NULL, 'g' },
{ "delete", no_argument, NULL, 'd' },
{ "update", no_argument, NULL, 'u' },
{ "type", required_argument, NULL, 't' },
+ { "list-types", no_argument, NULL, OPT_LIST_TYPES },
{ "nr", required_argument, NULL, 'n' },
{ "output", required_argument, NULL, 'o' },
{ "pairs", no_argument, NULL, 'P' },
case 'v':
verbose = 1;
break;
+ case OPT_LIST_TYPES:
+ {
+ size_t idx = 0;
+ const char *name = NULL;
+
+ while (blkid_partitions_get_name(idx++, &name) == 0)
+ puts(name);
+ return EXIT_SUCCESS;
+ }
case 'h':
usage(stdout);
case 'V':