added "idlist" mode to print "vendor:product name"
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8488 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -246,6 +246,21 @@ human_camera_func (const func_params_t *params,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
idlist_camera_func (const func_params_t *params,
|
||||
const int i,
|
||||
const CameraAbilities *a)
|
||||
{
|
||||
if (a->usb_vendor) { /* usb product id may be zero! */
|
||||
printf("%04x:%04x %s\n",
|
||||
a->usb_vendor,
|
||||
a->usb_product,
|
||||
a->model);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
udev_begin_func (const func_params_t *params)
|
||||
{
|
||||
@@ -536,6 +551,14 @@ static const output_format_t formats[] = {
|
||||
camera_func: udev_camera_func,
|
||||
end_func: udev_end_func
|
||||
},
|
||||
{name: "idlist",
|
||||
descr: "list of IDs and names",
|
||||
help: "grep for an ID to find the device name",
|
||||
paramdescr: NULL,
|
||||
begin_func: empty_begin_func,
|
||||
camera_func: idlist_camera_func,
|
||||
end_func: empty_end_func
|
||||
},
|
||||
{NULL, NULL, NULL, NULL,
|
||||
NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user