diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index f93406db..4ef3481b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -176,13 +176,24 @@ pub struct Shell<'a> { } impl<'a> Shell<'a> { - pub fn new(program: &'a str) -> Shell<'a> { + pub fn new<S>(program: S) -> Shell<'a> + where S: Into<Cow<'a, str>> + { Shell { - program: Cow::from(program), + program: program.into(), args: Vec::new(), } } + pub fn new_with_args<S>(program: S, args: Vec<String>) -> Shell<'a> + where S: Into<Cow<'a, str>> + { + Shell { + program: program.into(), + args: args + } + } + pub fn program(&self) -> &str { &*self.program } |