#prompt #sudo #permissions

sudo_prompt

Provides a dialog prompt to run a command using sudo

1 unstable release

0.1.0 Jan 8, 2023

#660 in Unix APIs

MIT license

15KB
447 lines

sudo-prompt-rs

sudo-prompt-rs provides a dialog prompt to run a command using sudo. This is a rewrite of sudo-prompt in Rust.

Mac:

Linux:

Windows: TODO: new images here

Usage

use sudo_prompt::{Opts, SudoPrompt};

fn main() {
  // TODO provide "new" method
  let prompt = SudoPrompt {};
  let resp = prompt.exec(&Opts {
      cmd: r#"env"#.to_string(),
      env: None,
      name: None,
  }).unwrap();
}

TODO: example here

Dependencies

~2–13MB
~132K SLoC