serde-cmd

Crates.ioserde-cmd
lib.rsserde-cmd
version0.1.3
sourcesrc
created_at2021-12-08 17:19:56.894512
updated_at2021-12-09 00:02:42.883248
descriptionA small library to deserialize commands
homepagehttps://git.sr.ht/~grego/serde-cmd
repositoryhttps://git.sr.ht/~grego/serde-cmd
max_upload_size
id494618
size10,663
(grego)

documentation

README

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.

Commit count: 0

cargo fmt