diff options
author | Tim Jenssen <tim.jenssen@nokia.com> | 2011-07-14 18:18:19 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@nokia.com> | 2011-07-14 18:18:19 +0200 |
commit | dca0e1f61a962791a29b761b988918a9cc1f47aa (patch) | |
tree | 395956f7dae4a2750582069c2ad643c747b9d771 /tools | |
parent | 06a3777d73401a1a601bcc75e02162c8c0744e34 (diff) |
add showAvailableOperations to operationrunner
Diffstat (limited to 'tools')
-rw-r--r-- | tools/operationrunner/operationrunner.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/operationrunner/operationrunner.cpp b/tools/operationrunner/operationrunner.cpp index f5c9c5fb2..91328f14b 100644 --- a/tools/operationrunner/operationrunner.cpp +++ b/tools/operationrunner/operationrunner.cpp @@ -80,11 +80,19 @@ int main(int argc, char **argv) QStringList argumentList = app.arguments(); - if( argumentList.count() < 2 || argumentList.contains("--help") ) - { + QInstaller::init(); + QInstaller::VerboseWriter::instance(); + + if (argumentList.contains("--showAvailableOperations")) { + std::cout << "AvailableOperations: " << std::endl; + std::cout << "\t" << qPrintable(KDUpdater::UpdateOperationFactory::instance().availableUpdateOperations().join("\n\t")) << std::endl; + } + + if (argumentList.count() < 2 || argumentList.contains("--help")) { printUsage(); return 1; } + argumentList.removeFirst(); // we don't need the application name QString sdkTargetDir; @@ -101,14 +109,9 @@ int main(int argc, char **argv) argumentList.removeAt(sdkTargetDirArgumentPosition); } - - QInstaller::init(); - - QInstaller::VerboseWriter::instance(); - + //now all output goes into the log file next to the application QInstaller::setVerbose( true ); - QString operationName = argumentList.takeFirst(); KDUpdater::UpdateOperation* const operation = KDUpdater::UpdateOperationFactory::instance().create(operationName); if (!operation) { @@ -145,7 +148,7 @@ int main(int argc, char **argv) std::cerr << "\tNote: if you see something like installer is null/empty then --sdktargetdir argument was missing." << std::endl; } return 0; - } catch ( const QInstaller::Error& e ) { + } catch (const QInstaller::Error& e) { std::cerr << qPrintable(e.message()) << std::endl; } return 1; |