cli: add run-privileged
This commit is contained in:
parent
d42add4d18
commit
da6ddf1317
2 changed files with 41 additions and 0 deletions
11
src/cli.rs
11
src/cli.rs
|
|
@ -2,6 +2,7 @@ mod generate;
|
|||
mod idle;
|
||||
mod log;
|
||||
mod quit;
|
||||
mod run_privileged;
|
||||
pub mod screenshot;
|
||||
mod set_log_level;
|
||||
mod unlock;
|
||||
|
|
@ -47,6 +48,8 @@ pub enum Cmd {
|
|||
Screenshot(ScreenshotArgs),
|
||||
/// Inspect/modify the idle (screensaver) settings.
|
||||
Idle(IdleArgs),
|
||||
/// Run a privileged program
|
||||
RunPrivileged(RunPrivilegedArgs),
|
||||
#[cfg(feature = "it")]
|
||||
RunTests,
|
||||
}
|
||||
|
|
@ -63,6 +66,13 @@ pub struct IdleArgs {
|
|||
pub command: Option<IdleCmd>,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct RunPrivilegedArgs {
|
||||
/// The program to run
|
||||
#[clap(required = true)]
|
||||
pub program: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
pub enum IdleCmd {
|
||||
/// Print the idle status.
|
||||
|
|
@ -190,6 +200,7 @@ pub fn main() {
|
|||
Cmd::Screenshot(a) => screenshot::main(cli.global, a),
|
||||
Cmd::Idle(a) => idle::main(cli.global, a),
|
||||
Cmd::Unlock => unlock::main(cli.global),
|
||||
Cmd::RunPrivileged(a) => run_privileged::main(cli.global, a),
|
||||
#[cfg(feature = "it")]
|
||||
Cmd::RunTests => crate::it::run_tests(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue