summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkimg
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2014-09-27 17:58:03 +0000
committermarcel <marcel@FreeBSD.org>2014-09-27 17:58:03 +0000
commit2bf89afb2b390cf0e131c1d6b2f377b480f4bf21 (patch)
tree7d7bf8f48f5c82e2bed56ada4a60d91b9e129a1a /usr.bin/mkimg
parentb3d712b9b9c9f56779f38d24b84008c9438d3ad5 (diff)
downloadFreeBSD-src-2bf89afb2b390cf0e131c1d6b2f377b480f4bf21.zip
FreeBSD-src-2bf89afb2b390cf0e131c1d6b2f377b480f4bf21.tar.gz
Update the usage message and the man page to account for the new long
options. Bump the version number to 20140927. While here, use explicit fputc() calls to skip a line in the output. This to avoid having to hunt for extra '\n' characters in the printf format strings. MFC after: 1 week Relnotes: yes
Diffstat (limited to 'usr.bin/mkimg')
-rw-r--r--usr.bin/mkimg/Makefile2
-rw-r--r--usr.bin/mkimg/mkimg.130
-rw-r--r--usr.bin/mkimg/mkimg.c18
3 files changed, 40 insertions, 10 deletions
diff --git a/usr.bin/mkimg/Makefile b/usr.bin/mkimg/Makefile
index a0bc579..7745566 100644
--- a/usr.bin/mkimg/Makefile
+++ b/usr.bin/mkimg/Makefile
@@ -6,7 +6,7 @@ PROG= mkimg
SRCS= format.c image.c mkimg.c scheme.c
MAN= mkimg.1
-MKIMG_VERSION=20140926
+MKIMG_VERSION=20140927
CFLAGS+=-DMKIMG_VERSION=${MKIMG_VERSION}
CFLAGS+=-DSPARSE_WRITE
diff --git a/usr.bin/mkimg/mkimg.1 b/usr.bin/mkimg/mkimg.1
index db492ed..bfe05c0 100644
--- a/usr.bin/mkimg/mkimg.1
+++ b/usr.bin/mkimg/mkimg.1
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 12, 2014
+.Dd September 27, 2014
.Dt MKIMG 1
.Os
.Sh NAME
@@ -44,6 +44,8 @@
.Fl s Ar scheme
.Fl p Ar partition
.Op Fl p Ar partition ...
+.Nm
+.Ar --formats | --schemes | --version
.Sh DESCRIPTION
The
.Nm
@@ -122,10 +124,32 @@ utility will generate predictable values for Universally Unique Identifiers
.Nm
utility will create images that are identical.
.Pp
-For a complete list of supported partitioning schemes or supported output
-format, or for a detailed description of how to specify partitions, run the
+A set of long options exist to query about the
+.Nm
+utilty itself.
+Options in this set should be given by themselves because the
+.Nm
+utility exits immediately after providing the requested information.
+The version of the
+.Nm
+utility is printed when the
+.Ar --version
+option is given.
+The list of supported output formats is printed when the
+.Ar --formats
+option is given and the list of supported partitioning schemes is printed
+when the
+.Ar --schemes
+option is given.
+Both the format and scheme lists a space-separated lists for easy handling
+in scripts.
+.Pp
+For a more descriptive list of supported partitioning schemes or supported
+output format, or for a detailed description of how to specify partitions,
+run the
.Nm
utility without any arguments.
+This will print a usage message with all the necessary details.
.Sh ENVIRONMENT
.Bl -tag -width "TMPDIR" -compact
.It Ev TMPDIR
diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c
index 8c26c7e..d054423 100644
--- a/usr.bin/mkimg/mkimg.c
+++ b/usr.bin/mkimg/mkimg.c
@@ -79,7 +79,7 @@ print_formats(int usage)
const char *sep;
if (usage) {
- fprintf(stderr, "\n formats:\n");
+ fprintf(stderr, " formats:\n");
SET_FOREACH(f_iter, formats) {
f = *f_iter;
fprintf(stderr, "\t%s\t- %s\n", f->name,
@@ -103,7 +103,7 @@ print_schemes(int usage)
const char *sep;
if (usage) {
- fprintf(stderr, "\n schemes:\n");
+ fprintf(stderr, " schemes:\n");
SET_FOREACH(s_iter, schemes) {
s = *s_iter;
fprintf(stderr, "\t%s\t- %s\n", s->name,
@@ -138,9 +138,14 @@ usage(const char *why)
{
warnx("error: %s", why);
- fprintf(stderr, "\nusage: %s <options>\n", getprogname());
+ fputc('\n', stderr);
+ fprintf(stderr, "usage: %s <options>\n", getprogname());
fprintf(stderr, " options:\n");
+ fprintf(stderr, "\t--formats\t- list image formats\n");
+ fprintf(stderr, "\t--schemes\t- list partition schemes\n");
+ fprintf(stderr, "\t--version\t- show version information\n");
+ fputc('\n', stderr);
fprintf(stderr, "\t-b <file>\t- file containing boot code\n");
fprintf(stderr, "\t-f <format>\n");
fprintf(stderr, "\t-o <file>\t- file to write image into\n");
@@ -152,11 +157,12 @@ usage(const char *why)
fprintf(stderr, "\t-P <num>\t- physical sector size\n");
fprintf(stderr, "\t-S <num>\t- logical sector size\n");
fprintf(stderr, "\t-T <num>\t- number of tracks to simulate\n");
-
+ fputc('\n', stderr);
print_formats(1);
+ fputc('\n', stderr);
print_schemes(1);
-
- fprintf(stderr, "\n partition specification:\n");
+ fputc('\n', stderr);
+ fprintf(stderr, " partition specification:\n");
fprintf(stderr, "\t<t>[/<l>]::<size>\t- empty partition of given "
"size\n");
fprintf(stderr, "\t<t>[/<l>]:=<file>\t- partition content and size "
OpenPOWER on IntegriCloud