Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MU3] Fix printing user errors in musescore.cpp #7118

Merged
merged 1 commit into from Dec 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 16 additions & 8 deletions mscore/musescore.cpp
Expand Up @@ -2001,7 +2001,8 @@ MuseScore::MuseScore()
const bool loadSuccess = _loginManager->load();

if (cliSaveOnline && !loadSuccess) {
qFatal(qUtf8Printable(tr("No login credentials stored. Please sign in via the GUI.")));
fprintf(stderr, "%s\n", qPrintable(tr("No login credentials stored. Please sign in via the GUI.")));
::exit(EXIT_FAILURE);
}
}

Expand Down Expand Up @@ -7768,7 +7769,8 @@ MuseScoreApplication::CommandLineParseResult MuseScoreApplication::parseCommandL
MScore::noGui = true;

if (parser.positionalArguments().isEmpty()) {
qFatal("Must specify at least one score to save online.");
fprintf(stderr, "%s\n", qPrintable(tr("Must specify at least one score to save online.")));
::exit(EXIT_FAILURE);
}
}

Expand Down Expand Up @@ -7822,8 +7824,10 @@ MuseScoreApplication::CommandLineParseResult MuseScoreApplication::parseCommandL
diffMode = true;
}
if (parser.isSet("run-test-script")) {
if (rawDiffMode || diffMode)
qFatal("incompatible options");
if (rawDiffMode || diffMode) {
fprintf(stderr, "%s\n", qPrintable(tr("--run-test-script is incompatible with --diff and --raw-diff")));
::exit(EXIT_FAILURE);
}
MScore::noGui = true;
scriptTestMode = true;
}
Expand Down Expand Up @@ -7853,11 +7857,15 @@ MuseScoreApplication::CommandLineParseResult MuseScoreApplication::parseCommandL
}
}
if (rawDiffMode || diffMode) {
if (argv.size() != 2)
qFatal("Only two scores are needed for performing a comparison");
if (argv.size() != 2) {
fprintf(stderr, "%s\n", qPrintable(tr("Only two scores are needed for performing a comparison")));
::exit(EXIT_FAILURE);
}
}
if (scriptTestMode && argv.empty()) {
fprintf(stderr, "%s\n", qPrintable(tr("Please specify scripts to execute")));
::exit(EXIT_FAILURE);
}
if (scriptTestMode && argv.empty())
qFatal("Please specify scripts to execute");

parseResult.argv = argv;
return parseResult;
Expand Down