From 8878bfdd330af289c5c9a0d10bd2a757d1d9e02d Mon Sep 17 00:00:00 2001 From: Raphael Dumusc Date: Tue, 24 Jan 2017 15:00:00 +0100 Subject: [PATCH] Unified command line options of applications --- apps/DesktopStreamer/CMakeLists.txt | 4 ++-- apps/DesktopStreamer/main.cpp | 15 ++++++++++++++- apps/QmlStreamer/main.cpp | 3 ++- apps/SimpleStreamer/main.cpp | 11 ++++++----- doc/Changelog.md | 2 ++ 5 files changed, 26 insertions(+), 9 deletions(-) diff --git a/apps/DesktopStreamer/CMakeLists.txt b/apps/DesktopStreamer/CMakeLists.txt index 1a7ee78..0689661 100644 --- a/apps/DesktopStreamer/CMakeLists.txt +++ b/apps/DesktopStreamer/CMakeLists.txt @@ -1,5 +1,5 @@ -# Copyright (c) 2013-2016, EPFL/Blue Brain Project +# Copyright (c) 2013-2017, EPFL/Blue Brain Project # Raphael Dumusc set(DESKTOPSTREAMER_HEADERS @@ -66,7 +66,7 @@ if(MSVC) list(APPEND DESKTOPSTREAMER_LINK_LIBRARIES Ws2_32) endif() -common_application(${DESKTOPSTREAMER_APP_NAME} GUI NOHELP) +common_application(${DESKTOPSTREAMER_APP_NAME} GUI) if(APPLE) # create a zip for Puppet deployment diff --git a/apps/DesktopStreamer/main.cpp b/apps/DesktopStreamer/main.cpp index de2911e..5ced8c3 100644 --- a/apps/DesktopStreamer/main.cpp +++ b/apps/DesktopStreamer/main.cpp @@ -1,6 +1,6 @@ /*********************************************************************/ /* Copyright (c) 2011 - 2012, The University of Texas at Austin. */ -/* Copyright (c) 2013-2016, EPFL/Blue Brain Project */ +/* Copyright (c) 2013-2017, EPFL/Blue Brain Project */ /* Raphael Dumusc */ /* All rights reserved. */ /* */ @@ -40,10 +40,23 @@ #include "MainWindow.h" +#include + +#include + int main( int argc, char* argv[] ) { QApplication app( argc, argv ); + QApplication::setApplicationVersion( + QString::fromStdString( deflect::Version::getString( ))); + + QCommandLineParser parser; + parser.setApplicationDescription( "Stream your desktop to a remote host" ); + parser.addHelpOption(); + parser.addVersionOption(); + parser.process( app ); + Q_INIT_RESOURCE( resources ); MainWindow mainWindow; diff --git a/apps/QmlStreamer/main.cpp b/apps/QmlStreamer/main.cpp index b4bfa52..36f6cfa 100644 --- a/apps/QmlStreamer/main.cpp +++ b/apps/QmlStreamer/main.cpp @@ -31,7 +31,8 @@ int main( int argc, char** argv ) app.setQuitOnLastWindowClosed( true ); QCommandLineParser parser; - parser.setApplicationDescription( "QmlStreamer example" ); + parser.setApplicationDescription( "Stream an offscreen QML scene to a remote" + " host" ); parser.addHelpOption(); parser.addVersionOption(); diff --git a/apps/SimpleStreamer/main.cpp b/apps/SimpleStreamer/main.cpp index 4369fe1..ee32627 100644 --- a/apps/SimpleStreamer/main.cpp +++ b/apps/SimpleStreamer/main.cpp @@ -176,11 +176,12 @@ void initDeflectStream() void syntax( char* app ) { - std::cout << "syntax: " << app << " [options] " << std::endl; - std::cout << "options:" << std::endl; - std::cout << " -n set stream identifier (default: 'SimpleStreamer')" << std::endl; - std::cout << " -i enable interaction events (default: OFF)" << std::endl; - std::cout << " -u enable uncompressed streaming (default: OFF)" << std::endl; + std::cout << "Usage: " << app << " [options] " << std::endl; + std::cout << "Stream a GLUT teapot to a remote host\n" << std::endl; + std::cout << "Options:" << std::endl; + std::cout << " -n set stream identifier (default: 'SimpleStreamer')" << std::endl; + std::cout << " -i enable interaction events (default: OFF)" << std::endl; + std::cout << " -u enable uncompressed streaming (default: OFF)" << std::endl; } void display() diff --git a/doc/Changelog.md b/doc/Changelog.md index ca7f86a..34493f2 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -5,6 +5,8 @@ Changelog {#Changelog} ### 0.12.1 (git master) +* [146](https://github.com/BlueBrain/Deflect/pull/146): + Unified the command line options and help message of applications. * [145](https://github.com/BlueBrain/Deflect/pull/145): DesktopStreamer: new slider to adjust the JPEG quality in advanced settings.