summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-10-10 15:33:33 -0700
committerJohn Stebbins <[email protected]>2016-10-10 15:34:57 -0700
commitd36e966478ab0a86a04833d76b676aec3758bb78 (patch)
tree65c1d20960ba016054612b3ab2289918a05e800e /test
parent57ffe59e3cbed0035d6d0eeec764f7fea07a343e (diff)
CLI: fix short arg optional parameter processing
Some short args were missing the '::' flags to indicate optional parameters. Also distinguish missing parameters from unknown options.
Diffstat (limited to 'test')
-rw-r--r--test/test.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/test.c b/test/test.c
index e9ff3126c..dad76c46d 100644
--- a/test/test.c
+++ b/test/test.c
@@ -2113,8 +2113,8 @@ static int ParseOptions( int argc, char ** argv )
cur_optind = optind;
c = getopt_long( argc, argv,
- "hv::uC:f:4i:Io:PUt:c:m::M:a:A:6:s:F::N:e:E:Q:C:"
- "2dD:7895gOw:l:n:b:q:S:B:r:R:x:TY:X:Z:z",
+ ":hv::C:f:i:Io:Pt:c:m::M:a:A:6:s:F::N:e:E:Q:C:"
+ "2d::D:7::8::9::5::gOw:l:n:b:q:B:r:R:x:TY:X:Z:z",
long_options, &option_index );
if( c < 0 )
{
@@ -2735,9 +2735,15 @@ static int ParseOptions( int argc, char ** argv )
hb_qsv_impl_set_preferred(optarg);
break;
#endif
+ case ':':
+ fprintf( stderr, "missing parameter (%s)\n", argv[cur_optind] );
+ return -1;
+
default:
+ case '?':
fprintf( stderr, "unknown option (%s)\n", argv[cur_optind] );
return -1;
+
}
}