aboutsummaryrefslogtreecommitdiff
path: root/src/qmmpui/commandlinemanager.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-03-05 17:40:01 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2017-03-05 17:40:01 +0000
commit2f376a7ebcfc4103b50c523eff7655f619c77353 (patch)
tree219a408556740105141949a920bda942441e7f0d /src/qmmpui/commandlinemanager.cpp
parentf731ee7de3fe936c65349d70650fe90045e79c8e (diff)
downloadqmmp-2f376a7ebcfc4103b50c523eff7655f619c77353.tar.gz
qmmp-2f376a7ebcfc4103b50c523eff7655f619c77353.tar.bz2
qmmp-2f376a7ebcfc4103b50c523eff7655f619c77353.zip
changed command line api
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@7069 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/commandlinemanager.cpp')
-rw-r--r--src/qmmpui/commandlinemanager.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/qmmpui/commandlinemanager.cpp b/src/qmmpui/commandlinemanager.cpp
index 889d8d419..ac2e95aaa 100644
--- a/src/qmmpui/commandlinemanager.cpp
+++ b/src/qmmpui/commandlinemanager.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2008-2016 by Ilya Kotov *
+ * Copyright (C) 2008-2017 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -103,5 +103,22 @@ void CommandLineManager::printUsage()
{
checkOptions();
foreach(CommandLineOption *opt, *m_options)
- cout << qPrintable(opt->helpString());
+ {
+ foreach (QString line, opt->helpString())
+ {
+ QString str = formatHelpString(line);
+ if(!str.isEmpty())
+ cout << qPrintable(str) << endl;
+ }
+ }
+}
+
+QString CommandLineManager::formatHelpString(const QString &line)
+{
+ QStringList list = line.split("||", QString::SkipEmptyParts);
+ if(list.count() == 1)
+ return list.at(0);
+ else if(list.count() >= 2)
+ return list.at(0).leftJustified(25) + list.at(1);
+ return QString();
}