Crates.io | get_env |
lib.rs | get_env |
version | 0.1.0 |
source | src |
created_at | 2018-07-24 16:26:07.121874 |
updated_at | 2018-07-24 16:26:07.121874 |
description | Get argv and envp by hook or by crook. This library goes further than the stdlib to get arguments and environment variables, including reading from /proc/self/cmdline and similar. |
homepage | https://github.com/alecmocatta/get_env |
repository | https://github.com/alecmocatta/get_env |
max_upload_size | |
id | 75783 |
size | 34,216 |
Get argv and envp by hook or by crook.
This library goes further than the stdlib to get arguments and environment
variables, including reading from /proc/self/cmdline
and similar.
This is helpful for library crates that don't want to require them to be passed
down to the library by the user; particularly if called from a non-Rust
application where the Rust stdlib hasn't had a chance to capture them from the
int main (int argc, char *argv[])
invocation thus breaking std::env::args()
.
extern crate get_env;
pub fn my_library_func() {
let args = get_env::args();
let vars = get_env::vars();
}
This currently requires Rust nightly for the used
feature.
Licensed under Apache License, Version 2.0, (LICENSE.txt or http://www.apache.org/licenses/LICENSE-2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.