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

#231 in #serde

Download history 1/week @ 2023-11-20 10/week @ 2023-11-27 8/week @ 2024-02-05 3/week @ 2024-02-12 18/week @ 2024-02-19 24/week @ 2024-02-26 12/week @ 2024-03-04

58 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–360KB