watchexec_supervisor/command/
program.rs

1use std::path::PathBuf;
2
3use super::Shell;
4
5/// A single program call.
6#[derive(Clone, Debug, PartialEq, Eq, Hash)]
7pub enum Program {
8	/// A raw program call: the path or name of a program and its argument list.
9	Exec {
10		/// Path or name of the program.
11		prog: PathBuf,
12
13		/// The arguments to pass.
14		args: Vec<String>,
15	},
16
17	/// A shell program: a string which is to be executed by a shell.
18	///
19	/// (Tip: in general, a shell will handle its own job control, so there's no inherent need to
20	/// set `grouped: true` at the [`Command`](super::Command) level.)
21	Shell {
22		/// The shell to run.
23		shell: Shell,
24
25		/// The command line to pass to the shell.
26		command: String,
27
28		/// The arguments to pass to the shell invocation.
29		///
30		/// This may not be supported by all shells. Note that some shells require the use of `--`
31		/// for disambiguation: this is not handled by Watchexec, and will need to be the first
32		/// item in this vec if desired.
33		///
34		/// This appends the values within to the shell process invocation.
35		args: Vec<String>,
36	},
37}