Re: disklabel(8): reduce usage()

2021-06-22 Thread Jason McIntyre
On Tue, Jun 22, 2021 at 12:36:02PM -0600, Todd C. Miller wrote:
> On Tue, 22 Jun 2021 13:34:43 +0100, Jason McIntyre wrote:
> 
> > diff to reduce verbosity in disklabel(8) usage. before:
> 
> OK.  Should we also remove SEEALSO from sbin/disklabel/Makefile
> and distrib/special/disklabel/Makefile?
> 
>  - todd
> 

ah, now i see the point of SEEALSO! how about this?
(completely untested for distrib/special)

jmc

Index: distrib/special/disklabel/Makefile
===
RCS file: /cvs/src/distrib/special/disklabel/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- distrib/special/disklabel/Makefile  21 Jul 2020 13:56:09 -  1.11
+++ distrib/special/disklabel/Makefile  22 Jun 2021 20:09:55 -
@@ -25,25 +25,6 @@ manual.c:disklabel.cat8
echo '};'; echo 'const int manpage_sz = sizeof(manpage);') > manual.c
 .endif
 
-.if ${MACHINE} == "alpha"
-CFLAGS+= -DSEEALSO="\"installboot(8)\""
-.endif
-
-.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || \
-${MACHINE} == "octeon" || ${MACHINE} == "loongson" || \
-${MACHINE} == "armv7" || ${MACHINE} == "arm64" || \
-${MACHINE} == "landisk" || ${MACHINE} == "powerpc64"
-CFLAGS+= -DSEEALSO="\"fdisk(8), installboot(8)\""
-.endif
-
-.if ${MACHINE} == "macppc"
-CFLAGS+= -DSEEALSO="\"fdisk(8), pdisk(8), installboot(8)\""
-.endif
-
-.if ${MACHINE} == "sparc64"
-CFLAGS+= -DSEEALSO="\"installboot(8)\"" -DSUN_CYLCHECK -DSUN_AAT0
-.endif
-
 .ifdef NOPIC
 CFLAGS+= -DSTATICLINKING
 .endif
Index: sbin/disklabel/Makefile
===
RCS file: /cvs/src/sbin/disklabel/Makefile,v
retrieving revision 1.68
diff -u -p -r1.68 Makefile
--- sbin/disklabel/Makefile 21 Jul 2020 13:56:08 -  1.68
+++ sbin/disklabel/Makefile 22 Jun 2021 20:09:55 -
@@ -25,23 +25,4 @@ manual.c:disklabel.cat8
echo '};'; echo 'const int manpage_sz = sizeof(manpage);') > manual.c
 .endif
 
-.if ${MACHINE} == "alpha"
-CFLAGS+= -DSEEALSO="\"installboot(8)\""
-.endif
-
-.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" || \
-${MACHINE} == "octeon" || ${MACHINE} == "loongson" || \
-${MACHINE} == "armv7" || ${MACHINE} == "arm64" || \
-${MACHINE} == "landisk" || ${MACHINE} == "powerpc64"
-CFLAGS+= -DSEEALSO="\"fdisk(8), installboot(8)\""
-.endif
-
-.if ${MACHINE} == "macppc"
-CFLAGS+= -DSEEALSO="\"fdisk(8), pdisk(8), installboot(8)\""
-.endif
-
-.if ${MACHINE} == "sparc64"
-CFLAGS+= -DSEEALSO="\"installboot(8)\"" -DSUN_CYLCHECK -DSUN_AAT0
-.endif
-
 .include 
Index: sbin/disklabel/disklabel.c
===
RCS file: /cvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.236
diff -u -p -r1.236 disklabel.c
--- sbin/disklabel/disklabel.c  14 Nov 2020 20:53:31 -  1.236
+++ sbin/disklabel/disklabel.c  22 Jun 2021 20:09:55 -
@@ -1212,28 +1212,15 @@ void
 usage(void)
 {
fprintf(stderr,
-   "usage: disklabel[-Acdtv] [-h | -p unit] [-T file] 
disk\t(read)\n");
+   "usage: disklabel[-Acdtv] [-h | -p unit] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -w [-Acdnv] [-T file] disk disktype 
[packid]\t(write)\n");
+   "   disklabel -w [-Acdnv] [-T file] disk disktype [packid]\n");
fprintf(stderr,
-   "   disklabel -e [-Acdnv] [-T file] disk\t\t\t(edit)\n");
+   "   disklabel -e [-Acdnv] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk\t(simple 
editor)"
-   "\n");
+   "   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -R [-nv] [-F|-f file] disk 
protofile\t\t(restore)\n\n");
-   fprintf(stderr,
-   "`disk' may be of the form: sd0 or /dev/rsd0%c.\n", 'a'+RAW_PART);
-   fprintf(stderr,
-   "`disktype' is an entry from %s, see disktab(5) for more info.\n",
-   DISKTAB);
-   fprintf(stderr,
-   "`packid' is an identification string for the device.\n");
-   fprintf(stderr,
-   "`protofile' is the output from the read cmd form; -R is 
powerful.\n");
-#ifdef SEEALSO
-   fprintf(stderr,
-   "For procedures specific to this architecture see: %s\n", SEEALSO);
-#endif
+   "   disklabel -R [-nv] [-F|-f file] disk protofile\n");
+
exit(1);
 }



Re: disklabel(8): reduce usage()

2021-06-22 Thread Todd C . Miller
On Tue, 22 Jun 2021 13:34:43 +0100, Jason McIntyre wrote:

> diff to reduce verbosity in disklabel(8) usage. before:

OK.  Should we also remove SEEALSO from sbin/disklabel/Makefile
and distrib/special/disklabel/Makefile?

 - todd



disklabel(8): reduce usage()

2021-06-22 Thread Jason McIntyre
hi.

diff to reduce verbosity in disklabel(8) usage. before:

$ /sbin/disklabel -Z
disklabel: unknown option -- Z
usage: disklabel[-Acdtv] [-h | -p unit] [-T file] disk  (read)
   disklabel -w [-Acdnv] [-T file] disk disktype [packid]   (write)
   disklabel -e [-Acdnv] [-T file] disk (edit)
   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk(simple editor)
   disklabel -R [-nv] [-F|-f file] disk protofile   (restore)

`disk' may be of the form: sd0 or /dev/rsd0c.
`disktype' is an entry from /etc/disktab, see disktab(5) for more info.
`packid' is an identification string for the device.
`protofile' is the output from the read cmd form; -R is powerful.
For procedures specific to this architecture see: fdisk(8), installboot(8)

after:

$ /usr/obj/sbin/disklabel/disklabel -Z
disklabel: unknown option -- Z
usage: disklabel[-Acdtv] [-h | -p unit] [-T file] disk
   disklabel -w [-Acdnv] [-T file] disk disktype [packid]
   disklabel -e [-Acdnv] [-T file] disk
   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk
   disklabel -R [-nv] [-F|-f file] disk protofile

ok?
jmc

Index: sbin/disklabel/disklabel.c
===
RCS file: /cvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.236
diff -u -p -r1.236 disklabel.c
--- sbin/disklabel/disklabel.c  14 Nov 2020 20:53:31 -  1.236
+++ sbin/disklabel/disklabel.c  22 Jun 2021 12:34:14 -
@@ -1212,28 +1212,15 @@ void
 usage(void)
 {
fprintf(stderr,
-   "usage: disklabel[-Acdtv] [-h | -p unit] [-T file] 
disk\t(read)\n");
+   "usage: disklabel[-Acdtv] [-h | -p unit] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -w [-Acdnv] [-T file] disk disktype 
[packid]\t(write)\n");
+   "   disklabel -w [-Acdnv] [-T file] disk disktype [packid]\n");
fprintf(stderr,
-   "   disklabel -e [-Acdnv] [-T file] disk\t\t\t(edit)\n");
+   "   disklabel -e [-Acdnv] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk\t(simple 
editor)"
-   "\n");
+   "   disklabel -E [-Acdnv] [-F|-f file] [-T file] disk\n");
fprintf(stderr,
-   "   disklabel -R [-nv] [-F|-f file] disk 
protofile\t\t(restore)\n\n");
-   fprintf(stderr,
-   "`disk' may be of the form: sd0 or /dev/rsd0%c.\n", 'a'+RAW_PART);
-   fprintf(stderr,
-   "`disktype' is an entry from %s, see disktab(5) for more info.\n",
-   DISKTAB);
-   fprintf(stderr,
-   "`packid' is an identification string for the device.\n");
-   fprintf(stderr,
-   "`protofile' is the output from the read cmd form; -R is 
powerful.\n");
-#ifdef SEEALSO
-   fprintf(stderr,
-   "For procedures specific to this architecture see: %s\n", SEEALSO);
-#endif
+   "   disklabel -R [-nv] [-F|-f file] disk protofile\n");
+
exit(1);
 }