This does away with the NONE mode and the corresponding usage error.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.SH NAME
vbig \- create or verify a large but pseudo-random file
.SH SYNOPSIS
-\fBvbig \fR[\fB--seed \fRSEED\fR] \fB--both\fR|\fB--create\fR|\fB--verify\fR \fIPATH \fR[\fISIZE\fR]
+\fBvbig \fR[\fB--seed \fRSEED\fR] [\fB--both\fR|\fB--create\fR|\fB--verify\fR] \fIPATH \fR[\fISIZE\fR]
.br
\fBvbig --help
.br
Selects both mode.
\fIPATH\fR will be filled with \fISIZE\fR psuedo-random bytes and
then read to check that it contains the data just written.
+This is the default.
.TP
.B --create\fR, \fB-c
Selects create mode.
// Possible modes of operation
enum mode_type {
- NONE,
VERIFY,
CREATE,
BOTH
static long long size;
int main(int argc, char **argv) {
- mode_type mode = NONE;
+ mode_type mode = BOTH;
int n;
while((n = getopt_long(argc, argv, "+s:vcefhV", opts, 0)) >= 0) {
switch(n) {
}
argc -= optind;
argv += optind;
- if(mode == NONE)
- fatal(0, "must specify one of --verify or --create");
if(argc > 2)
fatal(0, "excess arguments");
if(argc == 1 && mode == BOTH)