forked from qt-creator/qt-creator
Sdktool: Fix tabular help display
At least on Windows long commands (addDebugger, rmDebugger) have excess indentation. Change-Id: I10b56197dd2ad29f29a9df13146a393cea3aff1e Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
77482d2932
commit
d1b40c0062
@@ -58,6 +58,12 @@ void printHelp(const Operation *op)
|
|||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString tabular(const Operation *o)
|
||||||
|
{
|
||||||
|
const QString name = o->name();
|
||||||
|
return name + QString(16 - name.length(), QChar::Space) + o->helpText();
|
||||||
|
}
|
||||||
|
|
||||||
void printHelp(const QList<Operation *> &operations)
|
void printHelp(const QList<Operation *> &operations)
|
||||||
{
|
{
|
||||||
std::cout << "Qt Creator SDK setup tool." << std::endl;
|
std::cout << "Qt Creator SDK setup tool." << std::endl;
|
||||||
@@ -70,7 +76,7 @@ void printHelp(const QList<Operation *> &operations)
|
|||||||
std::cout << "OPERATION:" << std::endl;
|
std::cout << "OPERATION:" << std::endl;
|
||||||
std::cout << " One of:" << std::endl;
|
std::cout << " One of:" << std::endl;
|
||||||
foreach (const Operation *o, operations)
|
foreach (const Operation *o, operations)
|
||||||
std::cout << " " << qPrintable(o->name()) << "\t\t" << qPrintable(o->helpText()) << std::endl;
|
std::cout << " " << qPrintable(tabular(o)) << std::endl;
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
std::cout << "OPERATION_ARGS:" << std::endl;
|
std::cout << "OPERATION_ARGS:" << std::endl;
|
||||||
std::cout << " use \"--help <OPERATION>\" to get help on the arguments required for an operation." << std::endl;
|
std::cout << " use \"--help <OPERATION>\" to get help on the arguments required for an operation." << std::endl;
|
||||||
|
Reference in New Issue
Block a user