diff options
| author | suresh <sureshkrishnan.ai@gmail.com> | 2026-01-25 11:43:23 -0500 |
|---|---|---|
| committer | suresh <sureshkrishnan.ai@gmail.com> | 2026-01-25 11:43:23 -0500 |
| commit | 26a0b55ed5bce4ad0ba2af109cfc96da7be2e34c (patch) | |
| tree | 35ba8d7742b8ac727bfc6c4c73ab8b70f6eedb53 /examples/process | |
| parent | 0bb69cb67078dfa921b5b8a42275ef31dfbc9a56 (diff) | |
| parent | 489336b2101bf16edeec7bfc4379408eb19b936e (diff) | |
Merge branch 'main' into JsonType
# Conflicts:
# examples/data/json_config.zc
Diffstat (limited to 'examples/process')
| -rw-r--r-- | examples/process/env.zc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/process/env.zc b/examples/process/env.zc index 1506229..0ea7437 100644 --- a/examples/process/env.zc +++ b/examples/process/env.zc @@ -4,11 +4,11 @@ import "std/env.zc" fn main() -> int { // ---- - // get: Retrieves the env-var as borrowed string (char *) (no alloc) + // get: Retrieves the env-let as borrowed string (char *) (no alloc) // --- // @Example usage: On Linux (and some variants) PATH is already defined. // --- - var path = Env::get("PATH"); + let path = Env::get("PATH"); if (path.is_some()) { println "PATH is: {path.unwrap()}"; @@ -17,18 +17,18 @@ fn main() -> int { } // ---- - // set: Sets an env-var variable - // get_dup: Retrieves the env-var as caller-owned String() (heap alloc) + // set: Sets an env-let variable + // get_dup: Retrieves the env-let as caller-owned String() (heap alloc) // --- // @Example usage: In your terminal type "export HELLO=world" or use Env::set() // --- - var res = Env::set("HELLO", "world"); + let res = Env::set("HELLO", "world"); //=> check res against EnvRes::OK() - var hello = Env::get_dup("HELLO"); + let hello = Env::get_dup("HELLO"); if (hello.is_some()) { - var hello_str = hello.unwrap(); + let hello_str = hello.unwrap(); defer hello_str.free(); println "HELLO is: {hello_str.c_str()}"; @@ -37,11 +37,11 @@ fn main() -> int { } // ---- - // unset: Unsets an existing env-var + // unset: Unsets an existing env-let // --- Env::unset("HELLO"); - var hello_now2 = Env::get("HELLO"); + let hello_now2 = Env::get("HELLO"); if (hello_now2.is_none()) { println "HELLO is now unset"; |
