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

#48 in #command-arguments

Download history 14/week @ 2024-07-22 10/week @ 2024-07-29 4/week @ 2024-08-05 3/week @ 2024-08-12 7/week @ 2024-09-02 14/week @ 2024-09-09 7/week @ 2024-09-16 15/week @ 2024-09-23 13/week @ 2024-09-30 17/week @ 2024-10-14 11/week @ 2024-10-21 4/week @ 2024-10-28 37/week @ 2024-11-04

69 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

~105–335KB