Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improved algorithm help output
  • Loading branch information
nyalldawson committed Apr 15, 2020
1 parent 47cbd8c commit bbf7dfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/process/qgsprocess.cpp
Expand Up @@ -323,7 +323,7 @@ int QgsProcessingExec::showAlgorithmHelp( const QString &id )
std::cout << "----------------\n";
if ( !alg->shortDescription().isEmpty() )
std::cout << alg->shortDescription().toLocal8Bit().constData() << '\n';
if ( !alg->shortHelpString().isEmpty() )
if ( !alg->shortHelpString().isEmpty() && alg->shortHelpString() != alg->shortDescription() )
std::cout << alg->shortHelpString().toLocal8Bit().constData() << '\n';

std::cout << "\n----------------\n";
Expand All @@ -333,6 +333,9 @@ int QgsProcessingExec::showAlgorithmHelp( const QString &id )
const QgsProcessingParameterDefinitions defs = alg->parameterDefinitions();
for ( const QgsProcessingParameterDefinition *p : defs )
{
if ( p->flags() & QgsProcessingParameterDefinition::FlagHidden )
continue;

std::cout << QStringLiteral( "%1: %2\n" ).arg( p->name(), p->description() ).toLocal8Bit().constData();
std::cout << QStringLiteral( "\tArgument type:\t%1\n" ).arg( p->type() ).toLocal8Bit().constData();

Expand Down
2 changes: 2 additions & 0 deletions src/process/qgsprocess.h
Expand Up @@ -22,6 +22,8 @@
#include "qgspythonutils.h"
#include <QElapsedTimer>

class QgsApplication;

class ConsoleFeedback : public QgsProcessingFeedback
{
Q_OBJECT
Expand Down

0 comments on commit bbf7dfb

Please sign in to comment.