There was a typo in first part of Rainer&#39;s email.  Later on it shows its still not working.... although its safe fix I should probably submit.<br><br>I&#39;ve now been able to reproduce the issue with --help not working with the epson2 backend. The problem occurs when we reach driver specific help and so may be specific to epson2.  The all_options doesn&#39;t seem to contain the --help option and probably anything from basic_options[] array.<br>
<br>Since basic_options[] (which includes --help) is copied to all_options[] after filling in backend options, I suspect something returned by epson2 backend is causing a NULL to be placed in middle and causing getopt_long() to stop processing early.  I couldn&#39;t find anything obvious like missing options inits from browsing the code.  I guess it will need to be brute forced debugged to find where the NULL is coming from.<br>
<br>Chris<br><br><div class="gmail_quote">On Sun, Jan 3, 2010 at 5:06 PM, m. allan noah <span dir="ltr">&lt;<a href="mailto:kitno455@gmail.com">kitno455@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
good call chris- you want to submit a fix?<br>
<br>
allan<br>
<div class="im"><br>
On Sun, Jan 3, 2010 at 4:14 PM, Rainer Dorsch &lt;<a href="mailto:rdorsch@web.de">rdorsch@web.de</a>&gt; wrote:<br>
&gt; Hi Chris,<br>
&gt;<br>
&gt; Am Sonntag, 3. Januar 2010 schrieb Chris Bagwell:<br>
&gt;&gt; On Sun, Jan 3, 2010 at 7:01 AM, Rainer Dorsch &lt;<a href="mailto:rdorsch@web.de">rdorsch@web.de</a>&gt; wrote:<br>
&gt;&gt; &gt; For the long options issue:<br>
&gt;&gt; &gt; I rebuild git sane on another machine (also Debian stable aka Debian 5.0)<br>
&gt;&gt; &gt; and<br>
&gt;&gt; &gt; the long options error is still there. Even --help has problems. Which<br>
&gt;&gt; &gt; library is sane using to process the command line options? Does Debian<br>
&gt;&gt; &gt; stable<br>
&gt;&gt; &gt; maybe ship with a different version than your system?<br>
&gt;&gt;<br>
&gt;&gt; After running configure, can you look at the file include/sane/config.h?<br>
&gt;&gt; Check if HAVE_GETOPT_H and HAVE_GETOPT_LONG are defined.   On debian, I<br>
&gt;&gt; would expect them to be defined.  In that case, it uses standard libc<br>
&gt;&gt; version of getopt.<br>
&gt;<br>
&gt; As you expected, it is there:<br>
&gt;<br>
&gt; rd@blackbox:~/SW.nobackup/sane-backends$ grep HAVE_GETOPT<br>
&gt; include/sane/config.h<br>
&gt; #define HAVE_GETOPT_H 1<br>
&gt; #define HAVE_GETOPT_LONG 1<br>
</div><div class="im">&gt; rd@blackbox:~/SW.nobackup/sane-backends$<br>
&gt;<br>
</div><div class="im">&gt;&gt; I do see one suspicious line in lib/getopt.c and lib/getopt1.c.  They do a<br>
&gt;&gt; #include &lt;config.h&gt; instead of #include &quot;../include/sane/config.h&quot; and so<br>
&gt;&gt; in certain cases it may be including the wrong config.h file.  In that<br>
&gt;&gt; case, it would mistakenly compile a conflicting version of getopt_long()<br>
&gt;&gt; (which can explain the problem your seeing).<br>
&gt;<br>
&gt; Hmm...that does solve the problem:<br>
&gt;<br>
&gt; I did this modification<br>
&gt;<br>
</div>&gt; rd@blackbox:~/SW.nobackup/sane-backends$ git diff<br>
&gt; diff --git a/lib/getopt.c b/lib/getopt.c<br>
&gt; index 9dabb82..b8715e3 100644<br>
&gt; --- a/lib/getopt.c<br>
&gt; +++ b/lib/getopt.c<br>
&gt; @@ -20,7 +20,7 @@<br>
&gt;    License along with the GNU C Library; if not, write to the Free<br>
&gt;    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA<br>
&gt;    02111-1307 USA.  */<br>
<div class="im">&gt; -# include &lt;config.h&gt;<br>
&gt; +# include &quot;../include/sane/config.h&quot;<br>
</div>&gt;  #if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG)<br>
&gt;  ^L<br>
&gt;  /* This tells Alpha OSF/1 not to define a getopt prototype in &lt;stdio.h&gt;.<br>
&gt; diff --git a/lib/getopt1.c b/lib/getopt1.c<br>
&gt; index 5ace00a..082998c 100644<br>
&gt; --- a/lib/getopt1.c<br>
&gt; +++ b/lib/getopt1.c<br>
&gt; @@ -17,7 +17,7 @@<br>
&gt;    License along with the GNU C Library; if not, write to the Free<br>
&gt;    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA<br>
&gt;    02111-1307 USA.  */<br>
&gt; -#include &lt;config.h&gt;<br>
<div class="im">&gt; +#include &quot;../include/sane/config.h&quot;<br>
</div>&gt;  #if !defined(HAVE_GETOPT_H) || !defined(HAVE_GETOPT_LONG)<br>
&gt;  ^L<br>
&gt;  #ifdef HAVE_CONFIG_H<br>
<div class="im">&gt; rd@blackbox:~/SW.nobackup/sane-backends$<br>
&gt;<br>
</div><div class="im">&gt; recompiled, set the paths again<br>
&gt;<br>
&gt; rd@blackbox:~/SW.nobackup/sane-backends$ export |grep PATH<br>
&gt; declare -x LD_LIBRARY_PATH=&quot;/opt/sane-backends-091230/lib&quot;<br>
&gt; declare -x<br>
&gt; PATH=&quot;/opt/sane-backends-091230/bin:/usr/local/bin:/usr/bin:/bin:/usr/games&quot;<br>
</div><div class="im">&gt; rd@blackbox:~/SW.nobackup/sane-backends$<br>
&gt;<br>
</div><div class="im">&gt; and --help is still not recognized<br>
&gt;<br>
</div>&gt; rd@blackbox:~/SW.nobackup/sane-backends$ which scanimage<br>
&gt; /opt/sane-backends-091230/bin/scanimage<br>
<div class="im">&gt; rd@blackbox:~/SW.nobackup/sane-backends$<br>
&gt;<br>
</div>&gt; and --help is still not recogniced<br>
&gt;<br>
&gt; rd@blackbox:~/SW.nobackup/sane-backends$ scanimage --help<br>
&gt; Usage: scanimage [OPTION]...<br>
<div><div></div><div class="h5">&gt;<br>
&gt; Start image acquisition on a scanner device and write image data to<br>
&gt; standard output.<br>
&gt;<br>
&gt; Parameters are separated by a blank from single-character options (e.g.<br>
&gt; -d epson) and by a &quot;=&quot; from multi-character options<br>
&gt; (e.g. --device-name=epson).<br>
&gt; -d, --device-name=DEVICE   use a given scanner device (e.g. hp:/dev/scanner)<br>
&gt;    --format=pnm|tiff      file format of output file<br>
&gt; -i, --icc-profile=PROFILE  include this ICC profile into TIFF file<br>
&gt; -L, --list-devices         show available scanner devices<br>
&gt; -f, --formatted-device-list=FORMAT similar to -L, but the FORMAT of the output<br>
&gt;                           can be specified: %d (device name), %v (vendor),<br>
&gt;                           %m (model), %t (type), %i (index number), and<br>
&gt;                           %n (newline)<br>
&gt; -b, --batch[=FORMAT]       working in batch mode, FORMAT is `out%d.pnm&#39; or<br>
&gt;                           `out%d.tif&#39; by default depending on --format<br>
&gt;    --batch-start=#        page number to start naming files with<br>
&gt;    --batch-count=#        how many pages to scan in batch mode<br>
&gt;    --batch-increment=#    increase page number in filename by #<br>
&gt;    --batch-double         increment page number by two, same as<br>
&gt;                           --batch-increment=2<br>
&gt;    --batch-prompt         ask for pressing a key before scanning a page<br>
&gt;    --accept-md5-only      only accept authorization requests using md5<br>
&gt; -p, --progress             print progress messages<br>
&gt; -n, --dont-scan            only set options, don&#39;t actually scan<br>
&gt; -T, --test                 test backend thoroughly<br>
&gt; -h, --help                 display this help message and exit<br>
&gt; -v, --verbose              give even more status messages<br>
&gt; -B, --buffer-size=#        change input buffer size (in kB, default 32)<br>
&gt; -V, --version              print version information<br>
</div></div><div class="im">&gt; scanimage: unrecognized option `--help&#39;<br>
&gt; rd@blackbox:~/SW.nobackup/sane-backends$<br>
&gt;<br>
</div><div class="im">&gt; Thanks,<br>
&gt; Rainer<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Rainer Dorsch<br>
&gt; Lärchenstr. 6<br>
&gt; D-72135 Dettenhausen<br>
&gt; 07157-734133<br>
&gt; email: <a href="mailto:rdorsch@web.de">rdorsch@web.de</a><br>
&gt; jabber: <a href="mailto:rdorsch@jabber.org">rdorsch@jabber.org</a><br>
&gt; GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F  8F59 E3A8 C538 7519 141E<br>
&gt; Full GPG key: <a href="http://pgp.mit.edu/" target="_blank">http://pgp.mit.edu/</a><br>
&gt;<br>
</div>&gt; --<br>
&gt; sane-devel mailing list: <a href="mailto:sane-devel@lists.alioth.debian.org">sane-devel@lists.alioth.debian.org</a><br>
&gt; <a href="http://lists.alioth.debian.org/mailman/listinfo/sane-devel" target="_blank">http://lists.alioth.debian.org/mailman/listinfo/sane-devel</a><br>
&gt; Unsubscribe: Send mail with subject &quot;unsubscribe your_password&quot;<br>
&gt;             to <a href="mailto:sane-devel-request@lists.alioth.debian.org">sane-devel-request@lists.alioth.debian.org</a><br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
&quot;The truth is an offense, but not a sin&quot;<br>
</font></blockquote></div><br>