Merging upstream version 0.9.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
7a8d5107f2
commit
b4a17774a7
14 changed files with 193 additions and 200 deletions
|
@ -56,30 +56,30 @@ bool Arg_parser::parse_long_option( const char * const opt, const char * const a
|
|||
|
||||
if( ambig && !exact )
|
||||
{
|
||||
error_ = "option `"; error_ += opt; error_ += "' is ambiguous";
|
||||
error_ = "option '"; error_ += opt; error_ += "' is ambiguous";
|
||||
return false;
|
||||
}
|
||||
|
||||
if( index < 0 ) // nothing found
|
||||
{
|
||||
error_ = "unrecognized option `"; error_ += opt; error_ += '\'';
|
||||
error_ = "unrecognized option '"; error_ += opt; error_ += '\'';
|
||||
return false;
|
||||
}
|
||||
|
||||
++argind;
|
||||
data.push_back( Record( options[index].code ) );
|
||||
|
||||
if( opt[len+2] ) // `--<long_option>=<argument>' syntax
|
||||
if( opt[len+2] ) // '--<long_option>=<argument>' syntax
|
||||
{
|
||||
if( options[index].has_arg == no )
|
||||
{
|
||||
error_ = "option `--"; error_ += options[index].name;
|
||||
error_ = "option '--"; error_ += options[index].name;
|
||||
error_ += "' doesn't allow an argument";
|
||||
return false;
|
||||
}
|
||||
if( options[index].has_arg == yes && !opt[len+3] )
|
||||
{
|
||||
error_ = "option `--"; error_ += options[index].name;
|
||||
error_ = "option '--"; error_ += options[index].name;
|
||||
error_ += "' requires an argument";
|
||||
return false;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ bool Arg_parser::parse_long_option( const char * const opt, const char * const a
|
|||
{
|
||||
if( !arg || !arg[0] )
|
||||
{
|
||||
error_ = "option `--"; error_ += options[index].name;
|
||||
error_ = "option '--"; error_ += options[index].name;
|
||||
error_ += "' requires an argument";
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue