1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-24 09:49:42 +01:00

added --help command line option

This commit is contained in:
Michael Zanetti 2011-08-12 21:35:51 +02:00
parent 7baf43e3d7
commit aff075f2ad
2 changed files with 20 additions and 0 deletions

@ -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*

@ -108,6 +108,8 @@ private slots:
private:
void registerMetaTypes();
void printHelp();
// Start-up order: database, collection, pipeline, servent, http
void initDatabase();
void initLocalCollection();