Skip to content

Commit a8a3fd9

Browse files
authored
Change text references from "arguments" to "subcommands" (flameshot-org#3360)
1 parent 06cfa58 commit a8a3fd9

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

src/cli/commandlineparser.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ auto helpOption =
2424
CommandOption({ "h", "help" }, QStringLiteral("Displays this help"));
2525

2626
QString optionsToString(const QList<CommandOption>& options,
27-
const QList<CommandArgument>& arguments)
27+
const QList<CommandArgument>& subcommands)
2828
{
2929
int size = 0; // track the largest size
3030
QStringList dashedOptionList;
@@ -42,10 +42,10 @@ QString optionsToString(const QList<CommandOption>& options,
4242
}
4343
dashedOptionList << joinedDashedOptions;
4444
}
45-
// check the length of the arguments
46-
for (auto const& arg : arguments) {
47-
if (arg.name().length() > size) {
48-
size = arg.name().length();
45+
// check the length of the subcommands
46+
for (auto const& subcommand : subcommands) {
47+
if (subcommand.name().length() > size) {
48+
size = subcommand.name().length();
4949
}
5050
}
5151
// generate the text
@@ -60,17 +60,17 @@ QString optionsToString(const QList<CommandOption>& options,
6060
.arg(options.at(i).description().replace(
6161
QLatin1String("\n"), linePadding));
6262
}
63-
if (!arguments.isEmpty()) {
63+
if (!subcommands.isEmpty()) {
6464
result += QLatin1String("\n");
6565
}
6666
}
67-
if (!arguments.isEmpty()) {
68-
result += QObject::tr("Arguments") + ":\n";
67+
if (!subcommands.isEmpty()) {
68+
result += QObject::tr("Subcommands") + ":\n";
6969
}
70-
for (const auto& argument : arguments) {
70+
for (const auto& subcommand : subcommands) {
7171
result += QStringLiteral(" %1 %2\n")
72-
.arg(argument.name().leftJustified(size, ' '))
73-
.arg(argument.description());
72+
.arg(subcommand.name().leftJustified(size, ' '))
73+
.arg(subcommand.description());
7474
}
7575
return result;
7676
}
@@ -326,7 +326,7 @@ void CommandLineParser::printHelp(QStringList args, const Node* node)
326326
argName = qApp->applicationName();
327327
}
328328
QString argText =
329-
node->subNodes.isEmpty() ? "" : "[" + QObject::tr("arguments") + "]";
329+
node->subNodes.isEmpty() ? "" : "[" + QObject::tr("subcommands") + "]";
330330
helpText += (QObject::tr("Usage") + ": %1 [%2-" + QObject::tr("options") +
331331
QStringLiteral("] %3\n\n"))
332332
.arg(args.join(QStringLiteral(" ")))
@@ -339,9 +339,9 @@ void CommandLineParser::printHelp(QStringList args, const Node* node)
339339
helpText += "\n\n";
340340

341341
// add command options and subarguments
342-
QList<CommandArgument> subArgs;
342+
QList<CommandArgument> subcommands;
343343
for (const Node& n : node->subNodes) {
344-
subArgs.append(n.argument);
344+
subcommands.append(n.argument);
345345
}
346346
auto modifiedOptions = node->options;
347347
if (m_withHelp) {
@@ -350,7 +350,7 @@ void CommandLineParser::printHelp(QStringList args, const Node* node)
350350
if (m_withVersion && node == &m_parseTree) {
351351
modifiedOptions << versionOption;
352352
}
353-
helpText += optionsToString(modifiedOptions, subArgs);
353+
helpText += optionsToString(modifiedOptions, subcommands);
354354
// print it
355355
out << helpText;
356356
}

src/main.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,19 @@ int main(int argc, char* argv[])
173173
QObject::tr("Powerful yet simple to use screenshot software."));
174174
parser.setGeneralErrorMessage(QObject::tr("See") + " flameshot --help.");
175175
// Arguments
176-
CommandArgument fullArgument(QStringLiteral("full"),
177-
QObject::tr("Capture the entire desktop."));
176+
CommandArgument fullArgument(
177+
QStringLiteral("full"),
178+
QObject::tr("Capture screenshot of all monitors at the same time."));
178179
CommandArgument launcherArgument(QStringLiteral("launcher"),
179180
QObject::tr("Open the capture launcher."));
180181
CommandArgument guiArgument(
181182
QStringLiteral("gui"),
182183
QObject::tr("Start a manual capture in GUI mode."));
183184
CommandArgument configArgument(QStringLiteral("config"),
184185
QObject::tr("Configure") + " flameshot.");
185-
CommandArgument screenArgument(QStringLiteral("screen"),
186-
QObject::tr("Capture a single screen."));
186+
CommandArgument screenArgument(
187+
QStringLiteral("screen"),
188+
QObject::tr("Capture a screenshot of the specified monitor."));
187189

188190
// Options
189191
CommandOption pathOption(

0 commit comments

Comments
 (0)