mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
getEnv(): Return std::optional
This allows distinguishing between an empty value and no value.
This commit is contained in:
parent
fd900c45b5
commit
ba87b08f85
17 changed files with 60 additions and 63 deletions
|
@ -35,7 +35,7 @@ extern const std::string nativeSystem;
|
|||
|
||||
|
||||
/* Return an environment variable. */
|
||||
string getEnv(const string & key, const string & def = "");
|
||||
std::optional<std::string> getEnv(const std::string & key);
|
||||
|
||||
/* Get the entire environment. */
|
||||
std::map<std::string, std::string> getEnv();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue