1. accept capital letters too, like the interactive -E command does.
2. usage() is not the most appropriate error response. be more helpful.
Index: disklabel.c
===================================================================
RCS file: /home/tedu/cvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.166
diff -u -r1.166 disklabel.c
--- disklabel.c 30 Jun 2010 23:44:06 -0000 1.166
+++ disklabel.c 8 Aug 2010 05:07:02 -0000
@@ -188,10 +188,12 @@
op = WRITE;
break;
case 'p':
- if (strchr("bckmgt", optarg[0]) == NULL ||
- optarg[1] != '\0')
- usage();
- print_unit = optarg[0];
+ if (strchr("bckmgtBCKMGT", optarg[0]) == NULL ||
+ optarg[1] != '\0') {
+ fprintf(stderr, "Valid units are bckmgt\n");
+ exit(1);
+ }
+ print_unit = tolower(optarg[0]);
break;
case 'n':
donothing++;