first commit
This commit is contained in:
35
README.md
Normal file
35
README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Env Reader
|
||||
|
||||
This is a library to read .env files.
|
||||
|
||||
## Usage
|
||||
- `make lib`
|
||||
|
||||
```cpp
|
||||
|
||||
#include <expected>
|
||||
#include <string>
|
||||
#include <print>
|
||||
|
||||
#include "env.hpp"
|
||||
|
||||
using std::unexpected;
|
||||
using std::expected;
|
||||
using std::println;
|
||||
using std::string;
|
||||
|
||||
int main() {
|
||||
Env env;
|
||||
env.loadEnv("");
|
||||
expected<string, string> result = env.get("FIRST");
|
||||
if (!result.has_value()) {
|
||||
println("{}", result.error());
|
||||
return 1;
|
||||
}
|
||||
|
||||
println("{}", result.value());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user