lock 0.1.0

Lock your system. Supports macOS, Linux, and Windows.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate lock;

use lock::{FailureReason, lock};

fn main() {
    let result = lock();

    match result {
        Err(FailureReason::CannotExecute) => {
            panic!("Failed to execute lock command!")
        },
        Err(FailureReason::LinuxCommandNotFound) => {
            panic!("No applicable command found. Please consider installing \
                    xdg-screensaver, gnome-screensaver, or dm-tool, and try again.");
        }
        Ok(()) => (),
    }
}