From 86a26be6d6164662bac281eaebbfc53a142a2143 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Tue, 22 Aug 2017 13:46:04 +0200 Subject: [PATCH] ui: Improved help texts of CLI --- src/lib/utility/commandline/CommandLineParser.cpp | 10 +++++----- .../commandline/commands/CommandlineCommand.cpp | 2 +- .../commands/CommandlineCommandConfig.cpp | 14 +++++++------- .../commands/CommandlineCommandIndex.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib/utility/commandline/CommandLineParser.cpp b/src/lib/utility/commandline/CommandLineParser.cpp index ae8f59cd..aa904552 100644 --- a/src/lib/utility/commandline/CommandLineParser.cpp +++ b/src/lib/utility/commandline/CommandLineParser.cpp @@ -32,7 +32,7 @@ void CommandLineParser::setup() options.add_options() ("help,h", "Print this help message") ("version,v", "Version of Sourcetrail") - ("project-file", po::value(), "Open Sourcetrail with this project") + ("project-file", po::value(), "Open Sourcetrail with this project (.srctrlprj)") ; m_options.add(options); @@ -159,7 +159,7 @@ License* CommandLineParser::getLicensePtr() void CommandLineParser::printHelp() const { - std::cout << "Usage:\n sourcetrail [command] [option...] [positional arguments]\n\n"; + std::cout << "Usage:\n Sourcetrail [command] [option...] [positional arguments]\n\n"; // Commands std::cout << "Commands:\n"; @@ -167,7 +167,7 @@ void CommandLineParser::printHelp() const { std::cout << " " << Command->name() << "\n"; } - std::cout << "\n * Each Commands has his own --help\n"; + std::cout << "\n * Each command has its own --help\n"; std::cout << m_options << std::endl; @@ -230,7 +230,7 @@ void CommandLineParser::processProjectfile() if (m_projectFile.extension() != ".srctrlprj" && m_projectFile.extension() != ".coatiproject") { - m_errorString = errorstring + " has a wrong fileending"; + m_errorString = errorstring + " has a wrong file ending"; m_projectFile = FilePath(); return; } @@ -238,7 +238,7 @@ void CommandLineParser::processProjectfile() std::shared_ptr configManager = ConfigManager::createEmpty(); if (!configManager->load(TextAccess::createFromFile(m_projectFile))) { - m_errorString = errorstring + " could not be loaded(invalid)"; + m_errorString = errorstring + " could not be loaded (invalid)"; m_projectFile = FilePath(); return; } diff --git a/src/lib/utility/commandline/commands/CommandlineCommand.cpp b/src/lib/utility/commandline/commands/CommandlineCommand.cpp index b5e2ed4c..3a085c15 100644 --- a/src/lib/utility/commandline/commands/CommandlineCommand.cpp +++ b/src/lib/utility/commandline/commands/CommandlineCommand.cpp @@ -22,7 +22,7 @@ const std::string Command::name() void Command::printHelp() { - std::cout << "Usage:\n sourcetrail " + std::cout << "Usage:\n Sourcetrail " << m_name << " [option...]\n\n"; std::cout << m_options << std::endl; if (m_positional.max_total_count() > 0) diff --git a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp index d44dcdf6..68ba8514 100644 --- a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp +++ b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp @@ -92,24 +92,24 @@ void CommandConfig::setup() po::options_description options("Config Options"); options.add_options() ("help,h", "Print this help message") - ("indexerthreads,t", po::value(), "Set the number of threads used for indexing") + ("indexer-threads,t", po::value(), "Set the number of threads used for indexing (0 uses ideal thread count)") ("use-processes,p", po::value(), "Enable C/C++ Indexer threads to run in different processes. ") ("logging-enabled,l", po::value(), "Enable file/console logging ") ("verbose-indexer-logging-enabled,L", po::value(), - "Enable additional log of abstract syntax tree during the indexing. WARNINIG Slows down the indexing process") + "Enable additional log of abstract syntax tree during the indexing. WARNINIG Slows down indexing speed") ("jvm-path,j", po::value(), "Path to the location of the jvm library") ("jvm-max-memory,M", po::value(), "Set the maximum amount of memory for the JVM indexer(-1 for using the JVM default settings)") ("maven-path,m", po::value(), "Path to the maven binary") ("jre-system-library-paths,J", po::value>(), "paths to the jars of the JRE system library. " - "These jars can be found inside your JRE install directory(once per path or comma separated)") + "These jars can be found inside your JRE install directory (once per path or comma separated)") ("license-file,z", po::value(), "Enter license via Licensefile") ("license-string,Z", po::value(), "Enter licenes via commandline") ("global-header-search-paths,g", po::value>(), - "Global include paths(once per path or comma separated)") + "Global include paths (once per path or comma separated)") ("global-framework-search-paths,F", po::value>(), - "Global include paths(once per path or comma separated)") + "Global include paths (once per path or comma separated)") ("show,s", "displays all settings") ; @@ -132,7 +132,7 @@ void printVector(const std::string& title, const std::vector& vec) void CommandConfig::printSettings(ApplicationSettings* settings) { std::cout << "Sourcetrail Settings:\n" - << "\n indexerthread count: " << settings->getIndexerThreadCount() + << "\n indexer-threads: " << settings->getIndexerThreadCount() << "\n use-processes: " << settings->getMultiProcessIndexingEnabled() << "\n logging-enabled: " << settings->getLoggingEnabled() << "\n verbose-indexer-logging-enabled: " << settings->getVerboseIndexerLoggingEnabled() @@ -195,7 +195,7 @@ ReturnStatus CommandConfig::parse(std::vector& args) vm ); - parseAndSetValue(&ApplicationSettings::setIndexerThreadCount, "indexerthreads", settings, vm); + parseAndSetValue(&ApplicationSettings::setIndexerThreadCount, "indexer-threads", settings, vm); parseAndSetValue(&ApplicationSettings::setJavaMaximumMemory, "jvm-max-memory", settings, vm); parseAndSetValue(&ApplicationSettings::setMavenPath, "maven-path", settings, vm); diff --git a/src/lib/utility/commandline/commands/CommandlineCommandIndex.cpp b/src/lib/utility/commandline/commands/CommandlineCommandIndex.cpp index 5738767e..9693e731 100644 --- a/src/lib/utility/commandline/commands/CommandlineCommandIndex.cpp +++ b/src/lib/utility/commandline/commands/CommandlineCommandIndex.cpp @@ -20,8 +20,8 @@ void CommandIndex::setup() po::options_description options("Config Options"); options.add_options() ("help,h", "Print this help message") - ("full", "Paths for Sourcefiles") - ("project-file", po::value(), "Project file to index") + ("full,f", "Index full project (omit to only index new/changed files)") + ("project-file", po::value(), "Project file to index (.srctrlprj)") ; m_options.add(options);