summaryrefslogtreecommitdiff
path: root/src/optparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/optparser.cpp')
-rw-r--r--src/optparser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/optparser.cpp b/src/optparser.cpp
index bbac9d5..53efe92 100644
--- a/src/optparser.cpp
+++ b/src/optparser.cpp
@@ -53,7 +53,7 @@ void Bu::OptParser::parse( int argc, char **argv )
53 { 53 {
54 Bu::StrArray aParams( iCount ); 54 Bu::StrArray aParams( iCount );
55 aParams.append( sOpt ); 55 aParams.append( sOpt );
56 if( sExtraParam ) 56 if( sExtraParam.isSet() )
57 { 57 {
58 aParams.append( argv[j]+iEPos+1 ); 58 aParams.append( argv[j]+iEPos+1 );
59 } 59 }
@@ -65,11 +65,11 @@ void Bu::OptParser::parse( int argc, char **argv )
65 } 65 }
66 else if( pOpt->pProxy ) 66 else if( pOpt->pProxy )
67 { 67 {
68 if( pOpt->sOverride ) 68 if( pOpt->sOverride.isSet() )
69 { 69 {
70 pOpt->pProxy->setValue( pOpt->sOverride ); 70 pOpt->pProxy->setValue( pOpt->sOverride );
71 } 71 }
72 else if( sExtraParam ) 72 else if( sExtraParam.isSet() )
73 { 73 {
74 pOpt->pProxy->setValue( sExtraParam ); 74 pOpt->pProxy->setValue( sExtraParam );
75 } 75 }
@@ -117,7 +117,7 @@ void Bu::OptParser::parse( int argc, char **argv )
117 } 117 }
118 else if( pOpt->pProxy ) 118 else if( pOpt->pProxy )
119 { 119 {
120 if( pOpt->sOverride ) 120 if( pOpt->sOverride.isSet() )
121 { 121 {
122 pOpt->pProxy->setValue( pOpt->sOverride ); 122 pOpt->pProxy->setValue( pOpt->sOverride );
123 } 123 }
@@ -172,7 +172,7 @@ void Bu::OptParser::addOption( const Option &opt )
172 lOption.append( opt ); 172 lOption.append( opt );
173 if( opt.cOpt != '\0' ) 173 if( opt.cOpt != '\0' )
174 hsOption.insert( opt.cOpt, &lOption.last() ); 174 hsOption.insert( opt.cOpt, &lOption.last() );
175 if( opt.sOpt ) 175 if( opt.sOpt.isSet() )
176 hlOption.insert( opt.sOpt, &lOption.last() ); 176 hlOption.insert( opt.sOpt, &lOption.last() );
177} 177}
178 178
@@ -226,7 +226,7 @@ int Bu::OptParser::optHelp( StrArray /*aParams*/ )
226 if( (*i).cOpt != '\0' ) 226 if( (*i).cOpt != '\0' )
227 bHasShort = true; 227 bHasShort = true;
228 int lOptSize = (*i).sOpt.getSize() + (*i).sHelpDefault.getSize(); 228 int lOptSize = (*i).sOpt.getSize() + (*i).sHelpDefault.getSize();
229 if( (*i).sOpt && iMaxWidth < lOptSize ) 229 if( (*i).sOpt.isSet() && iMaxWidth < lOptSize )
230 iMaxWidth = lOptSize; 230 iMaxWidth = lOptSize;
231 } 231 }
232 int iIndent = 4; 232 int iIndent = 4;
@@ -260,7 +260,7 @@ int Bu::OptParser::optHelp( StrArray /*aParams*/ )
260 } 260 }
261 if( iMaxWidth > 0 ) 261 if( iMaxWidth > 0 )
262 { 262 {
263 if( (*i).sOpt ) 263 if( (*i).sOpt.isSet() )
264 { 264 {
265 sio << "--" << Fmt(iMaxWidth, Fmt::Left) 265 sio << "--" << Fmt(iMaxWidth, Fmt::Left)
266 << (*i).sOpt + (*i).sHelpDefault; 266 << (*i).sOpt + (*i).sHelpDefault;