Minor bug fixes in the help of calypTools

This commit is contained in:
jfmcarreira committed 2020-12-11 18:00:12 +00:00
1 parent f6cc0ffd29
commit 684cecd632
4 files changed
+35 -34

No files matched your search

+8 -9
View File
@@ -38,13 +38,13 @@
#include "CalypOptions.h"
#include "config.h"
#include "lib/CalypModuleIf.h"
#include <cstring>
#include <iostream>
#include <sstream>
#include "config.h"
#include "lib/CalypModuleIf.h"
using namespace std;
struct ParseFailure : public std::exception
@@ -284,7 +284,7 @@ bool CalypOptions::hasOpt( const ClpString& optName )
void CalypOptions::addDefaultOptions()
{
addOptions() /**/
( "help,h", "produce help message" ) /**/
( "help", "produce help message" ) /**/
( "version", "show version and exit" ) /**/
( "pel_fmts", "list pixel formats" ) /**/
( "quality_metrics", "list supported quality metrics" ) /**/
@@ -477,27 +477,26 @@ unsigned int CalypOptions::parseSHORT( unsigned int argc, char* argv[] )
return 1;
}
bool CalypOptions::parse( unsigned int argc, char* argv[] )
int CalypOptions::parse( unsigned int argc, char* argv[] )
{
try
{
m_aUnhandledArgs = scanArgv( argc, argv );
if( checkListingOpts() )
{
return false;
return 1;
}
}
catch( std::exception& e )
{
std::cerr << "error: " << e.what() << "\n";
return false;
return -1;
}
catch( ... )
{
std::cerr << "Exception of unknown type!\n";
}
return true;
return 0;
}
list<const char*> CalypOptions::scanArgv( unsigned int argc, char* argv[] )
+3 -3
View File
@@ -40,11 +40,11 @@
#ifndef __CALYPOPTIONS_H__
#define __CALYPOPTIONS_H__
#include "CalypDefs.h"
#include <list>
#include <map>
#include "CalypDefs.h"
/**
* \class OptionBase
* \ingroup CalypLibGrp
@@ -90,7 +90,7 @@ public:
CalypOptions( const ClpString& name = "" );
~CalypOptions();
bool parse( unsigned int argc, char* argv[] );
int parse( unsigned int argc, char* argv[] );
void parse( std::vector<ClpString> args_array );
std::list<const char*>& getUnhandledArgs() { return m_aUnhandledArgs; }