Filter command line args from Epic Launcher
Before this, the command line parser just ignore all arguments if unknown arguments are received. This is not ideal, because if somebody is actually using Krita for CLI batch processing, then the desirable behaviour on receiving unknown arguments should be to print an error message and return a non-zero exit code, instead of starting Krita as a blocking GUI process.
This attempts to actually filter out the args from the Epic launcher, as shown in https://dev.epicgames.com/docs/services/en-US/Interfaces/Auth/index.html#epicgameslauncher (though it looks like that info is missing the leading dash for epicenv
), and let QCommandLineParser fail if it encounters actually unknown args.
The args filtering is limited to Windows builds only.
I don't know the exact args passed by the Epic launcher, so I can't say this is 100% going to work properly.
Test Plan
Test with command lines:
krita AUTH_PASSWORD=kiki AUTH_TYPE=exchangecode -epicapp=krita -epicenv=Prod -EpicPortal -epicusername=kiki -epicuserid=1234 -epiclocale=en-US
krita AUTH_PASSWORD=kiki AUTH_TYPE=exchangecode -epicapp=krita -epicenv=Prod -EpicPortal -epicusername=kiki -epicuserid=1234 -epiclocale=en-US C:\path\to\krita\file.kra
krita C:\path\to\krita\file.kra
krita --help
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. -
I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) -
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.