splitty

Crates.iosplitty
lib.rssplitty
version1.0.2
sourcesrc
created_at2020-12-18 11:52:56.766787
updated_at2024-08-03 16:26:05.312321
descriptiona string splitter taking quotes into account
homepage
repositoryhttps://github.com/Canop/splitty
max_upload_size
id324311
size9,701
Denys Séguret (Canop)

documentation

README

MIT Latest Version docs Chat on Miaou

splitty

A no-std string splitter for which spaces between quotes aren't separators.

Quotes not starting or ending a substring are handled as ordinary characters.

use splitty::*;

let cmd = "xterm -e \"vi /some/path\"";

let mut token = split_unquoted_char(cmd, ' ')
    .unwrap_quotes(true);

assert_eq!(token.next(), Some("xterm"));
assert_eq!(token.next(), Some("-e"));
assert_eq!(token.next(), Some("vi /some/path"));
Commit count: 4

cargo fmt