aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorNiklas Claesson <nicke.claesson@gmail.com>2017-01-25 00:19:45 +0100
committerJoe Wilm <jwilm@users.noreply.github.com>2017-01-28 12:25:57 -0800
commit019daa8b69b2e3b402362b71eeb3c8408c2ab933 (patch)
tree083a05743781e19003bddf9f429923decfa78491 /src/config.rs
parent08f348ecea0b782cd8539850abe6309d0e5b06c9 (diff)
downloadalacritty-019daa8b69b2e3b402362b71eeb3c8408c2ab933.tar.gz
alacritty-019daa8b69b2e3b402362b71eeb3c8408c2ab933.zip
Add support for -e argument
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs15
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
}