From: Ian Jackson Date: Thu, 21 Feb 2013 15:46:00 +0000 (+0000) Subject: Make --both the default X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=220672d448f27f4579abf5dc0d3e843640d284c5;p=vbig.git Make --both the default This does away with the NONE mode and the corresponding usage error. Signed-off-by: Ian Jackson --- diff --git a/vbig.1 b/vbig.1 index e6f230d..be51425 100644 --- a/vbig.1 +++ b/vbig.1 @@ -19,7 +19,7 @@ .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 @@ -45,6 +45,7 @@ Optional. 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. diff --git a/vbig.cc b/vbig.cc index 47f314d..53ef6a5 100644 --- a/vbig.cc +++ b/vbig.cc @@ -61,7 +61,6 @@ static void help(void) { // Possible modes of operation enum mode_type { - NONE, VERIFY, CREATE, BOTH @@ -118,7 +117,7 @@ static bool flush = false; 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) { @@ -136,8 +135,6 @@ int main(int argc, char **argv) { } 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)