Index: webcamd.8 =================================================================== --- webcamd.8 (revision 3214) +++ webcamd.8 (working copy) @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" -.Dd August 19, 2014 +.Dd September 1, 2014 .Dt WEBCAMD 8 .Os FreeBSD .Sh NAME @@ -39,6 +39,7 @@ .Op Fl U Ar .Op Fl G Ar .Op Fl H +.Op Fl M Ar .Op Fl N Ar .Op Fl S Ar .Op Fl d Ar [ugen]. @@ -98,6 +99,11 @@ .It Fl S Attach to device matching the given serial number. This option can be combined with -d and -N options. +.It Fl M +Specify the match index when using -S and -N options. +This option is useful when multiple USB devices share the same serial +and devicename to be able to distinguish them. +Default is zero. .It Fl N Attach to device matching the given device name. This option can be combined with -d and -S options. Index: webcamd.c =================================================================== --- webcamd.c (revision 3214) +++ webcamd.c (working copy) @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -96,6 +97,7 @@ static int u_videodev = -1; static const char *u_devicename; static const char *u_serialname; +static int u_match_index; static int do_list; static int do_fork; static int do_realtime = 1; @@ -427,6 +429,7 @@ " -l Show available USB devices\n" " -S as output by -l option\n" " -N as output by -l option\n" + " -M for use with -S and -N options\n" " -v