splitty 1.0.2

a string splitter taking quotes into account
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 1 items with examples
  • Size
  • Source code size: 9.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.09 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Canop/splitty
    16 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Canop

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"));