tokfit/cli
The tokfit command.
Emits a single line of JSON on stdout. Bad usage leaves stdout empty, writes the usage string to stderr, and exits 1. There is no OTP process and no FFI, so the runtime’s panic message and stack trace accompany the usage string, every failure exits 1, and no finer-grained codes are available; they are not worth the machinery they would need.
Values
pub fn escape_json(input: String) -> String
Escape input for use inside a JSON string, without the surrounding
quotes. Non-ASCII is passed through, which JSON allows.