Crates.io | serde-cmd |
lib.rs | serde-cmd |
version | 0.1.3 |
source | src |
created_at | 2021-12-08 17:19:56.894512 |
updated_at | 2021-12-09 00:02:42.883248 |
description | A small library to deserialize commands |
homepage | https://git.sr.ht/~grego/serde-cmd |
repository | https://git.sr.ht/~grego/serde-cmd |
max_upload_size | |
id | 494618 |
size | 10,663 |
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.
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.