Expand description
Small helpers shared by the zx-compatible API: quoting, duration parsing, command assembly and name normalisation.
Re-exports§
pub use crate::local_bin::path_key;pub use crate::local_bin::prefer_local_bin;pub use crate::local_bin::PATH_DELIMITER;
Enums§
- ZxArg
- A value interpolated into a command template.
Traits§
- Into
ZxArg - Conversion of Rust values into command template arguments.
Functions§
- build_
cmd - Interleave template
pieceswith quotedargs. - duration_
from_ millis - Convert milliseconds into a
Duration, rejecting negative and NaN values. - is_
safe_ word - Returns
truewhenargonly consists of characters that never need quoting in a POSIX shell (letters, digits and_/.-+@:=,%). - parse_
bool - Parse
"true"/"false"; any other value yieldsNone. - parse_
duration - Parse a zx duration string:
"100"(ms),"500ms","2s"or"2m". - quote
- Quote a value for bash the way zx does.
- quote_
powershell - Quote a value for PowerShell the way zx does: empty ->
'', safe words unchanged, otherwise single-quoted with embedded quotes doubled. - random_
id - Random lower-case alphanumeric identifier (used for temp names and ids).
- split_
template - Split a
zx!format string on{}placeholders ({{}}is a literal{}). - to_
camel_ case - Convert
SOME_NAME/kebab-nameintosomeName/kebabName. - zx_arg
- Convert any supported value into a
ZxArg.
Type Aliases§
- QuoteFn
- Signature of the quoting function used to interpolate arguments.