args is now optional

master
rasul 4 years ago
parent 07b0b212dd
commit 7e30fb5d3a

@ -10,7 +10,7 @@ pub struct App {
/// path/command to run
pub command: String,
/// arguments
pub args: Vec<String>,
pub args: Option<Vec<String>>,
/// should the app be restarted if it exits successfully
pub restart_on_success: Option<bool>,
/// should the app be restarted if it exits unsuccessfully
@ -29,7 +29,8 @@ impl App {
info!("starting application {}", &self.name);
let mut command = Command::new(&self.command);
command.args(&self.args);
let args = self.args.as_ref();
command.args(args.unwrap_or(&Vec::new()));
match command.output() {
Ok(output) => {

@ -20,7 +20,9 @@ impl Proc {
let mut command = Command::new(&app.command);
command.stdout(Stdio::piped());
command.stderr(Stdio::piped());
command.args(&app.args);
let args = app.args.as_ref();
command.args(args.unwrap_or(&Vec::new()));
let process = command.spawn_async()?;
let token = Token(process.id().try_into()?);

@ -7,7 +7,6 @@ wait = true
[[app]]
name = "terminal"
command = "alacritty"
args = []
restart_on_success = false
restart_on_failure = true
restart_on_terminate = true
@ -21,5 +20,4 @@ args = ["-e", "env"]
[[app]]
name = "window manager"
command = "twm"
args = []
hold = true

Loading…
Cancel
Save