Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
options.cc File Reference
#include "options.h"
#include <spdlog/spdlog.h>
#include <CLI/CLI.hpp>
#include <cstdlib>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
#include <string>
#include <utility>
#include "cert_updater.h"
#include "comm/base.h"
#include "config.h"
#include "core/platform.h"
#include "core/version.h"
Include dependency graph for options.cc:

Functions

Options parseOptions (int argc, char **argv)
 Parse argv and load the config file into an Options value.
 

Function Documentation

◆ parseOptions()

Options parseOptions ( int  argc,
char **  argv 
)

Parse argv and load the config file into an Options value.

Loads a JSONC config file (comments allowed) into Options::config, layering it over the built-in defaults; the settings themselves have no command-line flags — the CLI carries only actions and cert-fetch sources. The config file is either the explicit --config path or, absent that, a motion-master.jsonc auto-discovered next to the executable (–config wins over it). On –list-adapters the adapters are printed and the process exits 0.

Parameters
argcArgument count forwarded from main().
argvArgument vector forwarded from main().
Returns
Fully populated Options.
Note
Never returns on –help, –version, –list-adapters, a CLI parse error, or a config parse or validation failure (config failures exit 1). The configured adapter is resolved later, at driver init, not here.