diff --git a/src/mirall/owncloudtheme.cpp b/src/mirall/owncloudtheme.cpp index a7735183b8..f400bf65d6 100644 --- a/src/mirall/owncloudtheme.cpp +++ b/src/mirall/owncloudtheme.cpp @@ -52,7 +52,7 @@ QString ownCloudTheme::about() const "

Copyright ownCloud, Inc.

" "

Licensed under the GNU General Public License (GPL) Version 2.0
" "ownCloud and the ownCloud Logo are registered trademarks of ownCloud, " - "Inc. in the United States, other countries, or both

" + "Inc. in the United States, other countries, or both.

" ) .arg(MIRALL_VERSION_STRING) .arg("http://" MIRALL_STRINGIFY(APPLICATION_DOMAIN)) diff --git a/src/owncloudcmd/owncloudcmd.cpp b/src/owncloudcmd/owncloudcmd.cpp index c9173bac82..ca94838573 100644 --- a/src/owncloudcmd/owncloudcmd.cpp +++ b/src/owncloudcmd/owncloudcmd.cpp @@ -30,9 +30,12 @@ #include "creds/httpcredentials.h" #include "owncloudcmd.h" #include "simplesslerrorhandler.h" - +#include "theme.h" #include "netrcparser.h" +#include "version.h" +#include "config.h" + #ifdef Q_OS_WIN32 #include #else @@ -115,9 +118,11 @@ public: void help() { - std::cout << "owncloudcmd - command line ownCloud client tool." << std::endl; + const char *binaryName = APPLICATION_EXECUTABLE "cmd"; + + std::cout << binaryName << " - command line " APPLICATION_NAME " client tool" << std::endl; std::cout << "" << std::endl; - std::cout << "Usage: owncloudcmd " << std::endl; + std::cout << "Usage: " << binaryName << " " << std::endl; std::cout << "" << std::endl; std::cout << "A proxy can either be set manually using --httpproxy or it" << std::endl; std::cout << "uses the setting from a configured sync client." << std::endl; @@ -127,21 +132,32 @@ void help() std::cout << " --httpproxy [proxy] Specify a http proxy to use." << std::endl; std::cout << " Proxy is http://server:port" << std::endl; std::cout << " --trust Trust the SSL certification." << std::endl; - std::cout << " --exclude [file] exclude list file" << std::endl; + std::cout << " --exclude [file] Exclude list file" << std::endl; std::cout << " --user, -u [name] Use [name] as the login name" << std::endl; std::cout << " --password, -p [pass] Use [pass] as password" << std::endl; std::cout << " -n Use netrc (5) for login" << std::endl; std::cout << " --non-interactive Do not block execution with interaction" << std::endl; + std::cout << " --version, -v Display version and exit" << std::endl; std::cout << "" << std::endl; exit(1); } +void showVersion() { + const char *binaryName = APPLICATION_EXECUTABLE "cmd"; + std::cout << binaryName << " version " << qPrintable(Theme::instance()->version()) << std::endl; + exit(1); +} + void parseOptions( const QStringList& app_args, CmdOptions *options ) { QStringList args(app_args); if( args.count() < 3 ) { + const QString option = args.at(1); + if (option == "-v" || option == "--version") { + showVersion(); + } help(); } @@ -206,7 +222,6 @@ int main(int argc, char **argv) { parseOptions( app.arguments(), &options ); - QUrl url = QUrl::fromUserInput(options.target_url); // Order of retrieval attempt (later attempts override earlier ones):