|
From: libvidcap c. <lib...@li...> - 2007-12-12 20:46:24
|
Revision: 83
http://libvidcap.svn.sourceforge.net/libvidcap/?rev=83&view=rev
Author: bcholew
Date: 2007-12-12 12:46:06 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
Fixup help message to include -2 option. Improve command line argument parsing. Thanks Pete Grayson.
Modified Paths:
--------------
trunk/examples/simplegrab.c
Modified: trunk/examples/simplegrab.c
===================================================================
--- trunk/examples/simplegrab.c 2007-12-12 20:43:46 UTC (rev 82)
+++ trunk/examples/simplegrab.c 2007-12-12 20:46:06 UTC (rev 83)
@@ -210,6 +210,7 @@
" -q -- decrease libvidcap verbosity\n"
" -e -- do enumeration test\n"
" -d -- do defaults test\n"
+ " -2 -- do double default test\n"
" -c -- do capture test\n"
" -n -- do notification test\n");
}
@@ -218,15 +219,6 @@
{
int i;
- if ( argc == 1 )
- {
- opt_do_enumeration = 1;
- opt_do_defaults = 1;
- opt_do_double_default = 1;
- opt_do_captures = 1;
- opt_do_notifies = 1;
- }
-
for ( i = 1; i < argc; ++i )
{
if ( !strcmp(argv[i], "-e") )
@@ -253,6 +245,22 @@
}
}
+ /* If none of the tests are explicitly set, then we go ahead
+ * and do all of them.
+ */
+ if ( !(opt_do_enumeration ||
+ opt_do_defaults ||
+ opt_do_double_default ||
+ opt_do_captures ||
+ opt_do_notifies) )
+ {
+ opt_do_enumeration = 1;
+ opt_do_defaults = 1;
+ opt_do_double_default = 1;
+ opt_do_captures = 1;
+ opt_do_notifies = 1;
+ }
+
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|