#env #env-var #arguments #environment #hook #further #reading

get_env

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

1 unstable release

Uses old Rust 2015

0.1.0 Jul 24, 2018

#1662 in Development tools

Apache-2.0

16KB
270 lines

get_env

Crates.io Apache-2.0 licensed Build Status Build Status Build Status

Docs

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().

Example

extern crate get_env;

pub fn my_library_func() {
	let args = get_env::args();
	let vars = get_env::vars();
}

Note

This currently requires Rust nightly for the used feature.

License

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.

Dependencies

~59KB