mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
added --help command line option
This commit is contained in:
@@ -124,6 +124,12 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
|||||||
void
|
void
|
||||||
TomahawkApp::init()
|
TomahawkApp::init()
|
||||||
{
|
{
|
||||||
|
if ( arguments().contains( "--help" ) || arguments().contains( "-h" ) )
|
||||||
|
{
|
||||||
|
printHelp();
|
||||||
|
::exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
Logger::setupLogfile();
|
Logger::setupLogfile();
|
||||||
qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) );
|
qsrand( QTime( 0, 0, 0 ).secsTo( QTime::currentTime() ) );
|
||||||
|
|
||||||
@@ -297,6 +303,18 @@ TomahawkApp::instance()
|
|||||||
return (TomahawkApp*)TOMAHAWK_APPLICATION::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
|
#ifndef TOMAHAWK_HEADLESS
|
||||||
AudioControls*
|
AudioControls*
|
||||||
|
@@ -108,6 +108,8 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void registerMetaTypes();
|
void registerMetaTypes();
|
||||||
|
|
||||||
|
void printHelp();
|
||||||
|
|
||||||
// Start-up order: database, collection, pipeline, servent, http
|
// Start-up order: database, collection, pipeline, servent, http
|
||||||
void initDatabase();
|
void initDatabase();
|
||||||
void initLocalCollection();
|
void initLocalCollection();
|
||||||
|
Reference in New Issue
Block a user