kopia lustrzana https://gitlab.com/sane-project/backends
Resolve "[hp5590] Read only values aren't accessible via CLI options (unrecognized option)"
rodzic
312edd6d5f
commit
a0ca5a4fc4
|
@ -917,9 +917,9 @@ fetch_options (SANE_Device * device)
|
||||||
scanimage_exit (1);
|
scanimage_exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create command line option only for settable options */
|
/* create command line option only for non-group options */
|
||||||
if (!SANE_OPTION_IS_SETTABLE (opt->cap) || opt->type == SANE_TYPE_GROUP)
|
if (opt->type == SANE_TYPE_GROUP)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
option_number[option_count] = i;
|
option_number[option_count] = i;
|
||||||
|
|
||||||
|
@ -1072,6 +1072,12 @@ process_backend_option (SANE_Handle device, int optnum, const char *optarg)
|
||||||
|
|
||||||
opt = sane_get_option_descriptor (device, optnum);
|
opt = sane_get_option_descriptor (device, optnum);
|
||||||
|
|
||||||
|
if (!SANE_OPTION_IS_SETTABLE (opt->cap))
|
||||||
|
{
|
||||||
|
fprintf (stderr, "%s: attempted to set readonly option %s\n",
|
||||||
|
prog_name, opt->name);
|
||||||
|
scanimage_exit (1);
|
||||||
|
}
|
||||||
if (!SANE_OPTION_IS_ACTIVE (opt->cap))
|
if (!SANE_OPTION_IS_ACTIVE (opt->cap))
|
||||||
{
|
{
|
||||||
fprintf (stderr, "%s: attempted to set inactive option %s\n",
|
fprintf (stderr, "%s: attempted to set inactive option %s\n",
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
scanimage: Attempts to set readonly options will give a warning about readonly option set attempt now, instead of the misleading "unknown option" error.
|
Ładowanie…
Reference in New Issue