namespace seams::cfg

Overview

namespace cfg {
 
// structs
 
struct Runtime;
 
// global functions
 
std::string pathFromArgv(int argc, char** argv);
void applyFile(const std::string& path, bool required);
Runtime load(std::string_view explicitFile = {});
void exportEnviron(const Runtime& cfg);
void dump(const Runtime& cfg, std::ostream& os);
 
} // namespace cfg

Detailed Documentation

Global Functions

std::string pathFromArgv(int argc, char** argv)

Scan argv for config PATH / config=PATH.

Empty if absent.

void applyFile(const std::string& path, bool required)

Apply a dotenv file: set KEY=VAL only when KEY is not already in the environment.

Throws if required and the file is missing.

Runtime load(std::string_view explicitFile = {})

Load file (if any) then read the environment into a Runtime.

void exportEnviron(const Runtime& cfg)

Write Runtime fields into the environment so libraries that only call getenv (linkcell, OpenMP offload) see the CLI result.