.BR \-f , " \-\-force"
Disable all consistency checking.
.TP
+.BR \-o , " \-\-output " \fIlist\fP
+Specify which output columns to print. Use
+.B \-\-help
+to get a list of all supported columns.
+
+The default list of columns may be extended if \fIlist\fP is
+specified in the format \fI+list\fP (e.g. \fB-o +UUID\fP).
+.TP
.BR \-O , " \-\-backup-file " \fIpath\fR
Override default backup file name. Note that the device name and offset is always
appended to the file name.
.TP
-.BR \-X , " \-\-label \fItype\fR
-Specify disk label type (e.g. dos, gpt, ...). If no label specified then sfdisk
-defaults to an existing label. If there is no label on the device than defaults
-to "dos".
-.TP
.BR \-q , " \-\-quiet"
Suppress extra info messages.
.TP
Deprecated and ignored option. Linux (and another moder OS) compatible
partitioning is the default.
.TP
+.BR \-X , " \-\-label \fItype\fR
+Specify disk label type (e.g. dos, gpt, ...). If no label specified then sfdisk
+defaults to an existing label. If there is no label on the device than defaults
+to "dos".
+.TP
.BR \-h , " \-\-help"
Display help text and exit.
.TP
fputs(_(" -A, --append append partitions to existing partition table\n"), out);
fputs(_(" -b, --backup backup partition table sectors (see -O)\n"), out);
fputs(_(" -f, --force disable all consistency checking\n"), out);
+ fputs(_(" -o, --output <list> output columns\n"), out);
fputs(_(" -O, --backup-file <path> override default backout file name\n"), out);
fputs(_(" -N, --partno <num> specify partition number\n"), out);
fputs(_(" -X, --label <name> specify label type (dos, gpt, ...)\n"), out);
fputs(USAGE_HELP, out);
fputs(USAGE_VERSION, out);
+ list_available_columns(out);
+
fprintf(out, USAGE_MAN_TAIL("sfdisk(8)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
int main(int argc, char *argv[])
{
+ const char *outarg = NULL;
int rc = -EINVAL, c, longidx = -1;
struct sfdisk _sf = {
.partno = -1
{ "list-types", no_argument, NULL, 'T' },
{ "no-act", no_argument, NULL, 'n' },
{ "no-reread", no_argument, NULL, OPT_NOREREAD },
+ { "output", required_argument, NULL, 'o' },
{ "partno", required_argument, NULL, 'N' },
{ "show-size", no_argument, NULL, 's' },
{ "show-geometry", no_argument, NULL, 'g' },
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "aAbcdfghlLO:nN:qsTu:vVX:",
+ while ((c = getopt_long(argc, argv, "aAbcdfghlLo:O:nN:qsTu:vVX:",
longopts, &longidx)) != -1) {
switch(c) {
case 'a':
case 'L':
warnx(_("--Linux option is unnecessary and deprecated"));
break;
+ case 'o':
+ outarg = optarg;
+ break;
case 'O':
sf->backup = 1;
sf->backup_file = optarg;
}
sfdisk_init(sf);
+ if (outarg)
+ init_fields(NULL, outarg, NULL);
if (sf->verify && !sf->act)
sf->act = ACT_VERIFY; /* --verify make be used with --list too */