Add device-id option to drivers
@@ -767,7 +767,6 @@ _papplMainloopShowDrivers(
int i; // Looping variable
pappl_system_t *system; // System object
-
if (!system_cb)
{
fprintf(stderr, "%s: No system callback specified.\n", base_name);
@@ -780,8 +779,27 @@ _papplMainloopShowDrivers(
return (1);
}
+ device_id = cupsGetOption("device-id", num_options, options);
+
+ if (!device_id)
+ {
+ for (i = 0; i < system->num_drivers; i ++)
+ {
+ printf("%s \"%s\" \"%s\"\n", system->drivers[i].name, system->drivers[i].description, system->drivers[i].device_id ? system->drivers[i].device_id : "");
+ }
+ }
+
+ else
+ {
+ if ((driver_name = (system->autoadd_cb)(NULL, NULL, device_id, data)))
+ {
for (i = 0; i < system->num_drivers; i ++)
+ {
+ if(!strcmp(driver_name, system->drivers[i].name))
printf("%s \"%s\" \"%s\"\n", system->drivers[i].name, system->drivers[i].description, system->drivers[i].device_id ? system->drivers[i].device_id : "");
+ }
+ }
+ }
papplSystemDelete(system);
