clap-cargo-extra 0.2.0

Tool to extend clap cargo adding some useful functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::process::Command;

use crate::Args;

pub trait ToCmd {
    fn add_args<'a>(&'a self, cmd: &'a mut Command) -> &'a mut Command;
}

impl<T> ToCmd for T
where
    T: Args,
{
    fn add_args<'a>(&'a self, cmd: &'a mut Command) -> &'a mut Command {
        cmd.args(self.to_args())
    }
}