From 1cb9382282daf0bc6d0206b10d294f1b4dd5ab30 Mon Sep 17 00:00:00 2001 From: Radu Butoi Date: Sun, 17 Jan 2021 15:52:54 -0500 Subject: [PATCH] Use argv[0] to print program name on a CLI error. --- application/MultiMC.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index bca922ed..8c1a53b6 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -207,8 +207,9 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv) catch (const ParsingError &e) { std::cerr << "CommandLineError: " << e.what() << std::endl; - std::cerr << "Try '%1 -h' to get help on MultiMC's command line parameters." - << std::endl; + if(argc > 0) + std::cerr << "Try '" << argv[0] << " -h' to get help on MultiMC's command line parameters." + << std::endl; m_status = MultiMC::Failed; return; }