Skip to content

Commit ecdbf86

Browse files
Fuzzbawlsfurszy
authored andcommitted
[Docs] Reformat -help output for help2man
Github-Pull: #2491 Rebased-From: d510ce0
1 parent 656be59 commit ecdbf86

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

src/pivx-cli.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,13 @@ static bool AppInitRPC(int argc, char* argv[])
7777
//
7878
gArgs.ParseParameters(argc, argv);
7979
if (argc < 2 || gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help") || gArgs.IsArgSet("-version")) {
80-
std::string strUsage = strprintf("%s RPC client version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n";
80+
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
8181
if (!gArgs.IsArgSet("-version")) {
82-
strUsage += "\nUsage:\n"
83-
" pivx-cli [options] <command> [params] " + strprintf("Send command to %s", PACKAGE_NAME) + "\n" +
84-
" pivx-cli [options] -named <command> [name=value] ... " + strprintf("Send command to %s (with named arguments)", PACKAGE_NAME) + "\n" +
85-
" pivx-cli [options] help List commands\n" +
86-
" pivx-cli [options] help <command> Get help for a command\n";
87-
82+
strUsage += "\n"
83+
"Usage: pivx-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
84+
"or: pivx-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
85+
"or: pivx-cli [options] help List commands\n"
86+
"or: pivx-cli [options] help <command> Get help for a command\n";
8887
strUsage += "\n" + HelpMessageCli();
8988
}
9089

src/pivx-tx.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,9 @@ static bool AppInitRawTx(int argc, char* argv[])
4747

4848
if (argc < 2 || gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help")) {
4949
// First part of help message is specific to this utility
50-
std::string strUsage = strprintf("%s pivx-tx utility version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n\n" +
51-
"Usage:\n"
52-
" pivx-tx [options] <hex-tx> [commands] Update hex-encoded pivx transaction\n" +
53-
" pivx-tx [options] -create [commands] Create hex-encoded pivx transaction\n" +
50+
std::string strUsage = PACKAGE_NAME " pivx-tx utility version " + FormatFullVersion() + "\n\n" +
51+
"Usage: pivx-tx [options] <hex-tx> [commands] Update hex-encoded pivx transaction\n" +
52+
"or: pivx-tx [options] -create [commands] Create hex-encoded pivx transaction\n" +
5453
"\n";
5554

5655
fprintf(stdout, "%s", strUsage.c_str());

src/pivxd.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ bool AppInit(int argc, char* argv[])
6161

6262
// Process help and version before taking care about datadir
6363
if (gArgs.IsArgSet("-?") || gArgs.IsArgSet("-h") || gArgs.IsArgSet("-help") || gArgs.IsArgSet("-version")) {
64-
std::string strUsage = strprintf("%s Daemon", PACKAGE_NAME) + " version " + FormatFullVersion() + "\n";
64+
std::string strUsage = PACKAGE_NAME " Daemon version " + FormatFullVersion() + "\n";
6565

6666
if (gArgs.IsArgSet("-version")) {
6767
strUsage += LicenseInfo();
6868
} else {
69-
strUsage += "\nUsage:\n"
70-
" pivxd [options] " + strprintf("Start %s Daemon", PACKAGE_NAME) + "\n";
71-
69+
strUsage += "\nUsage: pivxd [options] Start " PACKAGE_NAME " Daemon\n";
7270
strUsage += "\n" + HelpMessage(HMM_BITCOIND);
7371
}
7472

src/qt/utilitydialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget* parent, bool about) : QDialog(pare
7272
ui->helpMessage->setVisible(false);
7373
} else {
7474
setWindowTitle(tr("Command-line options"));
75-
QString header = "Usage:\n"
76-
" pivx-qt [command-line options] \n";
75+
QString header = "Usage: pivx-qt [command-line options] \n";
7776
QTextCursor cursor(ui->helpMessage->document());
7877
cursor.insertText(version);
7978
cursor.insertBlock();
@@ -88,7 +87,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget* parent, bool about) : QDialog(pare
8887
strUsage += HelpMessageOpt("-splash", strprintf("Show splash screen on startup (default: %u)", DEFAULT_SPLASHSCREEN));
8988
strUsage += HelpMessageOpt("-hidecharts", strprintf("Hide QT staking charts on startup (default: %u)", false));
9089
QString coreOptions = QString::fromStdString(strUsage);
91-
text = version + "\n" + header + "\n" + coreOptions;
90+
text = version + "\n\n" + header + "\n" + coreOptions;
9291

9392
QTextTableFormat tf;
9493
tf.setBorderStyle(QTextFrameFormat::BorderStyle_None);

0 commit comments

Comments
 (0)