PR#3 review: -l's arg is now optional

This commit is contained in:
RadsammyT 2024-03-23 00:27:27 -04:00 committed by Mike Lothian
parent 7a643511cb
commit 7117eddfa4
2 changed files with 7 additions and 6 deletions

View File

@ -52,7 +52,7 @@ std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system,
std::shared_ptr<Applet> caller_applet,
AppletId applet_id,
LibraryAppletMode mode) {
const auto program_id = static_cast<u64>(Service::AM::AppletIdToProgramId(applet_id));
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
if (program_id == 0) {
// Unknown applet
return {};
@ -94,7 +94,7 @@ std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& syste
std::shared_ptr<Applet> caller_applet,
AppletId applet_id,
LibraryAppletMode mode) {
const auto program_id = static_cast<u64>(Service::AM::AppletIdToProgramId(applet_id));
const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id));
auto process = std::make_unique<Process>(system);
auto applet = std::make_shared<Applet>(system, std::move(process), false);
@ -163,10 +163,11 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) {
}
}
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
WindowSystem& window_system)
: ServiceFramework{system_, "ILibraryAppletCreator"}, m_window_system{window_system},
m_applet{std::move(applet)} {
: ServiceFramework{system_, "ILibraryAppletCreator"},
m_window_system{window_system}, m_applet{std::move(applet)} {
static const FunctionInfo functions[] = {
{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"},
{1, nullptr, "TerminateAllLibraryApplets"},

View File

@ -236,7 +236,7 @@ int main(int argc, char** argv) {
{"fullscreen", no_argument, 0, 'f'},
{"help", no_argument, 0, 'h'},
{"game", required_argument, 0, 'g'},
{"applet-params", required_argument, 0, 'l'},
{"applet-params", optional_argument, 0, 'l'},
{"multiplayer", required_argument, 0, 'm'},
{"program", optional_argument, 0, 'p'},
{"user", required_argument, 0, 'u'},
@ -246,7 +246,7 @@ int main(int argc, char** argv) {
};
while (optind < argc) {
int arg = getopt_long(argc, argv, "g:fhvp::c:u:l:", long_options, &option_index);
int arg = getopt_long(argc, argv, "g:fhvp::c:u:l::", long_options, &option_index);
if (arg != -1) {
switch (static_cast<char>(arg)) {
case 'c':