~grego/serde-cmd

A small library to deserialize commands
Make make_command implementation work with borrowed command
Add make_command method to turn Cmd into an actual command
Derive Clone for Cmd and ArgIter

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~grego/serde-cmd
read/write
git@git.sr.ht:~grego/serde-cmd

You can also use your local clone with git send-email.

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.