From 9f7cbe624a91008a4cbe47c7b369c5e3f96a4eff Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 28 Nov 2014 13:45:37 -0700 Subject: Division fixes, better config, more tests. Other minor fixes and options such as --version being added. --- src/options.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/options.cpp') diff --git a/src/options.cpp b/src/options.cpp index 4d64b22..d9d34fa 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -1,5 +1,7 @@ #include "options.h" +#include "config.h" + #include "unitnumber.h" #include "unitparser.h" #include "number.h" @@ -34,6 +36,8 @@ Options::Options( int argc, char *argv[] ) : "use all remaining parameters as the equation (you may wish to quote " "your equation to prevent special characters from being interpreted by " "your shell)."); + addOption( Bu::slot(this, &Options::version), 'v', "version", + "Show the version string ('" CLIC_VERSION_STR "')"); addHelpOption('h', "help", "This help"); parse( argc, argv ); @@ -189,9 +193,15 @@ int Options::execute( Bu::StringArray aArgs ) lex.setRadix( iRadix ); Parser parser( lex, mbOut ); parser.parse(); - Bu::println( mbOut.getString() ); + Bu::print( mbOut.getString() ); exit( 0 ); return aArgs.getSize(); } +int Options::version( Bu::StringArray aArgs ) +{ + Bu::println( CLIC_VERSION_STR ); + exit( 0 ); + return 0; +} -- cgit v1.2.3