Skip to main content

bash_interop/
lib.rs

1//! Run bash under instrumentation, and hear what it says.
2//!
3//! | | | |
4//! |---|---|---|
5//! | [`shell`] | which bash a shell is, how it was started, what it has on | on `bash_strings` |
6//! | [`stack`] | a call stack, as an instrument records it and as Rust reads it | on `shell` |
7//! | [`rig`] | run a bash program, hear every shell in it, answer what they ask | on `shell` |
8//! | [`failure`] | one error for anything that stops work | on nothing |
9//! | [`scratch`] | a directory of bash scripts, and helpers a test builds shells from | |
10//!
11//! Values travel as bash's own quoted forms — the `bash-strings` crate.
12//! `stack` and `rig` are siblings: neither knows the other. A tool composes
13//! them — the walk goes into the bash a rig injects, through
14//! [`stack::with_walk`] — which is what `bashcap` and `bashprof` are.
15//!
16//! Both read a walk against the shell it was taken in, which is why `shell`
17//! sits under both: bash writes `$0` into `BASH_SOURCE` for code it was given
18//! rather than read, and no walk can say on its own which word that is.
19//!
20//! Start with [`rig`]'s module doc; the book is `docs/` — `docs/overview.md`
21//! in this crate's repository.
22
23pub mod failure;
24pub mod rig;
25pub mod scratch;
26pub mod shell;
27pub mod stack;