diff --git a/ChangeLog b/ChangeLog index 6d6d3a807..30e319458 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-03-13 m. allan noah + * frontend/scanimage.c, doc/scanimage.man: make -B (buffer-size) + selectable, and make long name consistent. (#309672 by Johannes Berg) + 2009-03-13 m. allan noah * tools/sane-desc.c: remove 8859-1 chars from string cleaner, enforce only printable ASCII on output diff --git a/doc/scanimage.man b/doc/scanimage.man index b8e18df91..be4b48fa2 100644 --- a/doc/scanimage.man +++ b/doc/scanimage.man @@ -28,7 +28,8 @@ scanimage \- scan an image .RB [ \-T | \-\-test ] .RB [ \-h | \-\-help ] .RB [ \-v | \-\-verbose ] -.RB [ \-B | \-\-buffersize ] +.RB [ \-B | \-\-buffer-size +.RI [= size ]] .RB [ \-V | \-\-version ] .RI [ device\-specific\-options ] .SH DESCRIPTION @@ -252,10 +253,8 @@ level. The .B \-B or -.B \-\-buffersize -option changes the input buffersize that -.B scanimage -uses from default 32*1024 to 1024*1024 kbytes. +.B \-\-buffer-size +changes the input buffer size from 32KB to the number kB specified or 1M. .PP The .B \-V diff --git a/frontend/scanimage.c b/frontend/scanimage.c index b6d49a528..c400daed0 100644 --- a/frontend/scanimage.c +++ b/frontend/scanimage.c @@ -88,7 +88,7 @@ static struct option basic_options[] = { {"progress", no_argument, NULL, 'p'}, {"test", no_argument, NULL, 'T'}, {"version", no_argument, NULL, 'V'}, - {"buffer_size", no_argument, NULL, 'B'}, + {"buffer-size", optional_argument, NULL, 'B'}, {"batch", optional_argument, NULL, 'b'}, {"batch-count", required_argument, NULL, OPTION_BATCH_COUNT}, {"batch-start", required_argument, NULL, OPTION_BATCH_START_AT}, @@ -105,7 +105,7 @@ static struct option basic_options[] = { #define OUTPUT_PNM 0 #define OUTPUT_TIFF 1 -#define BASE_OPTSTRING "d:hi:Lf:nvBVTbp" +#define BASE_OPTSTRING "d:hi:Lf:B::nvVTbp" #define STRIP_HEIGHT 256 /* # lines we increment image height */ static struct option *all_options; @@ -1718,7 +1718,10 @@ main (int argc, char **argv) progress = 1; break; case 'B': - buffer_size = (1024 * 1024); + if (optarg) + buffer_size = 1024 * atoi(optarg); + else + buffer_size = (1024 * 1024); break; case 'T': test = 1; @@ -1919,7 +1922,7 @@ Parameters are separated by a blank from single-character options (e.g.\n\ -T, --test test backend thoroughly\n\ -h, --help display this help message and exit\n\ -v, --verbose give even more status messages\n\ --B, --buffer-size change default input buffersize\n\ +-B, --buffer-size=# change input buffer size (in kB, default 32)\n\ -V, --version print version information\n"); }