Files
FEX-Emu--FEX/Source/Tools/FEXServer/ArgumentLoader.cpp
T
Ryan Houdek 5fe6afc270 FEXServer: Adds new FEXServer service
This is a relatively invasive change since multiple things needed to
happen at once.

* Socket based logging is removed
  * Logging has been replaced to only support stdout, stderr, and server
  * Server is now default and replaces what FEXLogServer did
  * Server logging now uses a pipe instead of a socket
  * Can be faster than stderr and stdout since the application doesn't
    need to wait on terminal output

* FEXMountDaemon has been removed
  * Functionality has been merged in to FEXServer

* FEXServer is always executed on FEX initialization time
  * Similar in behaviour to Wine's wineserver
  * Can explicitly start this before using FEX for logging purposes
  * Stays around until all instances of FEX exit
  * Will stick around for a short amount of time in case of spurious
    execution

* FEXServer will soon be extended to do more than logging and squashfs
  mounting

* FEX rootfs scripts will need to be updated to support this path
  * Just means rbinding the /tmp folder and forcing a FEXServer instance
    to be alive
* Pressure-vessel works fine in this case since FEXServer will already
  be running
  * It already rbinds the host /tmp folder which is why this works
2022-06-23 07:51:56 -07:00

47 lines
1.2 KiB
C++

#include "ArgumentLoader.h"
#include "OptionParser.h"
#include "git_version.h"
#include <fmt/format.h>
namespace FEXServer::Config {
static std::string Version = "FEX-Emu (" GIT_DESCRIBE_STRING ") ";
FEXServerOptions Load(int argc, char **argv) {
FEXServerOptions FEXOptions{};
optparse::OptionParser Parser = optparse::OptionParser()
.version(Version);
Parser.add_option("-k", "--kill")
.action("store_true")
.set_default(false)
.help("Shutdown an already active FEXServer");
Parser.add_option("-f", "--foreground")
.action("store_true")
.set_default(false)
.help("Run this FEXServer in the foreground");
Parser.add_option("-p", "--persistent")
.action("store")
.type("int")
.set_default(0)
.set_optional_value(true)
.metavar("n")
.help("Make FEXServer persistent. Optional number of seconds");
Parser.add_option("-v")
.action("version")
.help("Version string");
optparse::Values Options = Parser.parse_args(argc, argv);
FEXOptions.Kill = Options.get("kill");
FEXOptions.Foreground = Options.get("foreground");
FEXOptions.PersistentTimeout = Options.get("persistent");
return FEXOptions;
}
}