diff options
Diffstat (limited to '')
-rw-r--r-- | src/options.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/options.cpp b/src/options.cpp index 672858a..3ed2336 100644 --- a/src/options.cpp +++ b/src/options.cpp | |||
@@ -201,8 +201,9 @@ int Options::execute( Bu::StringArray aArgs ) | |||
201 | Parser parser( lex ); | 201 | Parser parser( lex ); |
202 | Expression *pExp = parser.parse(); | 202 | Expression *pExp = parser.parse(); |
203 | ScriptEngine se; | 203 | ScriptEngine se; |
204 | Number n = se.exec( pExp ); | 204 | se.sigError = Bu::slot( this, &Options::printError ); |
205 | Bu::println( n.toString() ); | 205 | se.sigNumResult = Bu::slot( this, &Options::printNumber ); |
206 | se.exec( pExp ); | ||
206 | exit( 0 ); | 207 | exit( 0 ); |
207 | return aArgs.getSize(); | 208 | return aArgs.getSize(); |
208 | } | 209 | } |
@@ -328,3 +329,13 @@ int Options::grind( Bu::StringArray aArgs ) | |||
328 | return 0; | 329 | return 0; |
329 | } | 330 | } |
330 | 331 | ||
332 | void Options::printError( const Bu::String &sMsg ) | ||
333 | { | ||
334 | Bu::println("ERROR: %1").arg( sMsg ); | ||
335 | } | ||
336 | |||
337 | void Options::printNumber( const class Number &rNum ) | ||
338 | { | ||
339 | Bu::println("%1").arg( rNum ); | ||
340 | } | ||
341 | |||