diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index 6fd9af544..3533a792c 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -124,6 +124,12 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] ) void TomahawkApp::init() { + if ( arguments().contains( "--help" ) || arguments().contains( "-h" ) ) + { + printHelp(); + ::exit(0); + } + Logger::setupLogfile(); qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) ); @@ -297,6 +303,18 @@ TomahawkApp::instance() return (TomahawkApp*)TOMAHAWK_APPLICATION::instance(); } +void +TomahawkApp::printHelp() +{ + std::cout << QString( "usage: " + arguments().at( 0 ) + " [options]" ).toAscii().data(); + std::cout << QString( "options are:" ).toAscii().data(); + std::cout << QString( " --help Show this help" ).toAscii().data(); + std::cout << QString( " --http Initialize HTTP server" ).toAscii().data(); + std::cout << QString( " --filescan Scan for files on startup" ).toAscii().data(); + std::cout << QString( " --testdb Use a test database instead of real collection" ).toAscii().data(); + std::cout << QString( " --noupnp Disable UPNP" ).toAscii().data(); + std::cout << QString( " --nosip Disable SIP" ).toAscii().data(); +} #ifndef TOMAHAWK_HEADLESS AudioControls* diff --git a/src/tomahawkapp.h b/src/tomahawkapp.h index ea13702e7..9e36f802b 100644 --- a/src/tomahawkapp.h +++ b/src/tomahawkapp.h @@ -108,6 +108,8 @@ private slots: private: void registerMetaTypes(); + void printHelp(); + // Start-up order: database, collection, pipeline, servent, http void initDatabase(); void initLocalCollection();