1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*-
* Copyright: see LICENSE file
*/
//! Safe Rust wrapper for the [getargv library](https://getargv.narzt.cam/).
//!
//! This crate provides a safe wrapper for the
//! [getargv-sys](https://docs.rs/getargv-sys/) crate which provides FFI
//! bindings to [libgetargv](https://getargv.narzt.cam/) which provides a
//! correct parser for the `KERN_PROCARGS2` `sysctl` which is how you access
//! the arguments of another process on macOS.
//!
//! This is the preferred crate for using
//! [libgetargv](https://getargv.narzt.cam/) in your Rust project.
//!
//!# External Deps
//! You must have [libgetargv](https://getargv.narzt.cam/) installed for
//! this crate to link to, it will not build/install it for you. If
//! `libgetargv.dylib` is not located in one of `clang`'s default search
//! paths, you must set the`LIBGETARGV_LIB_DIR` env var to tell `rustc`
//! where to find it, and you will either need to set the
//! `DYLD_FALLBACK_LIBRARY_PATH` env var at runtime to tell dyld where
//! to load it from, or you will need to use `install_name_tool` on your
//! binary to fixup the library load path.
//!
//!# Reason this crate is macOS only
//! On BSDs and Linuxen you can just read `/proc/$PID/cmdline` which is both
//! faster and easier than using this lib, Solaris has `pargs`, and I don't
//! use Windows so I can't support it, but you might want to look at the
//! [wmic](https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmic) tool.
//!
//! If you are writing a cross platform program, you can depend on this crate
//! only on macOS by specifying the dependency as:
//! ```toml
//! [target.'cfg(target_vendor = "apple")'.dependencies]
//! getargv = "~PKG_VERSION"
//! ```
//! <script>const version = document.querySelector('.version').innerText.match(/[0-9\.]+/)[0];
//! document.querySelectorAll('code').forEach(c=>c.innerText=c.innerText.replace('PKG_VERSION',version));
//! </script>
pub use crate*;
pub use crate*;