Minor fixes in argument parser and help of playuverTools
This commit is contained in:
1 parent
3ad1a61e82
commit
f1ea625b9b
5 files changed
+26
-22
No files matched your search
+15
-10
@@ -62,10 +62,10 @@ Bool PlaYUVerCmdParser::parse( Int argc, Char *argv[] )
|
||||
// m_cParserOptions.setDefaults();
|
||||
const std::list<const Char*>& argv_unhandled = scanArgv( m_cParserOptions, argc, ( const Char** )argv );
|
||||
|
||||
for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
{
|
||||
fprintf( stderr, "Unhandled argument ignored: `%s'\n", *it );
|
||||
}
|
||||
// for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
|
||||
// {
|
||||
// fprintf( stderr, "Unhandled argument ignored: `%s'\n", *it );
|
||||
// }
|
||||
|
||||
if( checkListingOpts() )
|
||||
{
|
||||
@@ -90,12 +90,6 @@ Bool PlaYUVerCmdParser::checkListingOpts()
|
||||
{
|
||||
Bool bRet = false;
|
||||
|
||||
if( m_cParserOptions["help"]->count() )
|
||||
{
|
||||
doHelp( std::cout, m_cParserOptions );
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
if( m_cParserOptions["version"]->count() )
|
||||
{
|
||||
std::cout << "PlaYUVer version "
|
||||
@@ -112,6 +106,17 @@ Bool PlaYUVerCmdParser::checkListingOpts()
|
||||
}
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
if( Opts()["quality_metrics"]->count() )
|
||||
{
|
||||
printf( "PlaYUVer supported quality metrics: \n" );
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
bRet |= true;
|
||||
}
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
Options m_cParserOptions;
|
||||
|
||||
Bool checkListingOpts();
|
||||
Void listModules();
|
||||
};
|
||||
|
||||
} // NAMESPACE
|
||||
@@ -51,6 +51,11 @@ using namespace std;
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
Options::Options( const std::string& name )
|
||||
{
|
||||
opt_name = name;
|
||||
}
|
||||
|
||||
Options::~Options()
|
||||
{
|
||||
for( Options::NamesPtrList::iterator it = opt_list.begin(); it != opt_list.end(); it++ )
|
||||
|
||||
@@ -227,6 +227,7 @@ private:
|
||||
class OptionSpecific;
|
||||
struct Options
|
||||
{
|
||||
Options( const std::string& name = "" );
|
||||
~Options();
|
||||
|
||||
OptionSpecific addOptions();
|
||||
@@ -261,6 +262,7 @@ struct Options
|
||||
NamesMap opt_long_map;
|
||||
NamesMap opt_short_map;
|
||||
|
||||
std::string opt_name;
|
||||
};
|
||||
|
||||
/* Class with templated overloaded operator(), for use by Options::addOptions() */
|
||||
|
||||
@@ -86,19 +86,10 @@ Int CommandLineHandle::parseToolsArgs( Int argc, Char *argv[] )
|
||||
m_uiLogLevel = RESULT;
|
||||
}
|
||||
|
||||
if( Opts()["quality_metrics"]->count() )
|
||||
if( Opts()["help"]->count() )
|
||||
{
|
||||
printf( "PlaYUVer supported quality metrics: \n" );
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
printf( " %s\n", PlaYUVerFrame::supportedQualityMetricsList()[i].c_str() );
|
||||
}
|
||||
iRet = 1;
|
||||
}
|
||||
|
||||
if( Opts()["module_list"]->count() || Opts()["module_list_full"]->count() )
|
||||
{
|
||||
listModules();
|
||||
printf( "Usage: %s modules/quality [options] -input=input_file [--output=output_file]\n", argv[0] );
|
||||
doHelp( std::cout, Opts() );
|
||||
iRet = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user