From 98bb9b3fb3353b71e567ea50fb53090fa30b3b47 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Mon, 1 Jun 2015 16:43:27 -0700 Subject: [PATCH] Added getInstalledDir to ToolApp. #4696 --- src/lib/synergy/ArgParser.cpp | 4 ++++ src/lib/synergy/ToolApp.cpp | 5 ++++- src/lib/synergy/ToolArgs.cpp | 1 + src/lib/synergy/ToolArgs.h | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/synergy/ArgParser.cpp b/src/lib/synergy/ArgParser.cpp index a2021481..91a9c866 100644 --- a/src/lib/synergy/ArgParser.cpp +++ b/src/lib/synergy/ArgParser.cpp @@ -180,6 +180,10 @@ ArgParser::parseToolArgs(ToolArgs& args, int argc, const char* const* argv) args.m_getPluginList = true; return true; } + else if (isArg(i, argc, argv, NULL, "--get-installed-dir", 0)) { + args.m_getInstalledDir = true; + return true; + } else if (isArg(i, argc, argv, NULL, "--get-plugin-dir", 0)) { args.m_getPluginDir = true; return true; diff --git a/src/lib/synergy/ToolApp.cpp b/src/lib/synergy/ToolApp.cpp index aa82fc88..ade16693 100644 --- a/src/lib/synergy/ToolApp.cpp +++ b/src/lib/synergy/ToolApp.cpp @@ -74,6 +74,9 @@ ToolApp::run(int argc, char** argv) else if (m_args.m_getPluginList) { getPluginList(); } + else if (m_args.m_getInstalledDir) { + std::cout << ARCH->getInstalledDirectory() << std::endl; + } else if (m_args.m_getPluginDir) { std::cout << ARCH->getPluginDirectory() << std::endl; } @@ -143,4 +146,4 @@ ToolApp::getPluginList() ss << "&password=" << password; std::cout << ARCH->internet().get(ss.str()) << std::endl; -} +} \ No newline at end of file diff --git a/src/lib/synergy/ToolArgs.cpp b/src/lib/synergy/ToolArgs.cpp index 5abd5476..8c3af4f1 100644 --- a/src/lib/synergy/ToolArgs.cpp +++ b/src/lib/synergy/ToolArgs.cpp @@ -22,6 +22,7 @@ ToolArgs::ToolArgs() : m_loginAuthenticate(false), m_getPluginList(false), m_getPluginDir(false), + m_getInstalledDir(false), m_getProfileDir(false) { } diff --git a/src/lib/synergy/ToolArgs.h b/src/lib/synergy/ToolArgs.h index c194c748..fe0d1bb9 100644 --- a/src/lib/synergy/ToolArgs.h +++ b/src/lib/synergy/ToolArgs.h @@ -28,6 +28,7 @@ public: bool m_loginAuthenticate; bool m_getPluginList; bool m_getPluginDir; + bool m_getInstalledDir; bool m_getProfileDir; bool m_getArch; };