Allow multiple --appendconfig options in command line
Description
If --appendconfig is used multiple times, only the last one takes effect; others are silently ignored.
This is fine if you're just invoking it directly; separate the configs you want with | and it works. But if you have something like this:
$ alias retroarch='retroarch --appendconfig=myconfig.cfg'
$ retroarch --appendconfig=myotherconfig.cfg
Only myotherconfig.cfg is loaded. The problem is obvious in that example, but it becomes much less so if, say, your distro ships a retroarch wrapper script that uses --appendconfig to apply distro-specific defaults, or if you're managing a family games library and want to use --appendconfig to make sure that shared save files and whatnot get stored in the right places.
Expected behavior
Ideally, all config files specified in any --appendconfig are loaded, in the order in which they appear. Failing that, an obvious error message saying that --appendconfig is only allowed once; that would at least have saved me a solid hour of debugging.
Actual behavior
retroarch appears to run without problems, but all uses of --appendconfig except the first are silently ignored.
Version/Commit
1.18.0.
Environment information
- OS: nixos