3 releases

0.1.3 Dec 9, 2021
0.1.2 Dec 8, 2021
0.1.1 Dec 8, 2021
0.1.0 Dec 8, 2021

#2952 in Parser implementations

Download history 24/week @ 2024-02-26 12/week @ 2024-03-04 10/week @ 2024-03-11 19/week @ 2024-03-18 31/week @ 2024-04-01 4/week @ 2024-04-08 6/week @ 2024-04-15 5/week @ 2024-04-22 5/week @ 2024-04-29 19/week @ 2024-05-13 9/week @ 2024-05-20 14/week @ 2024-05-27 14/week @ 2024-06-03 17/week @ 2024-06-10

56 downloads per month
Used in 2 crates (via blades)

MIT license

10KB
221 lines

A simple library to parse a command with arguments.

On a string that represents a command, such as one that is supposed to be passed to a shell, one can't simply use split_whitespace, since some argumenst may be quoted and contain multiple words. This crate provides an analogous parser, which keeps quoted items together.

Serde

Additionlay, when the serde feature is enabled (which is the case by default), this crate provides a type Cmd which implements Deserialize. There is also a type CmdBorrow, which doesn't do any copying unless necessary. Note that to use it when automatically deriving Deserialize, the field of this type needs to be marked with #[serde(borrow)] attribute.

Dependencies

~110–345KB