is-root

Crates.iois-root
lib.rsis-root
version0.1.3
sourcesrc
created_at2020-08-16 09:22:04.81624
updated_at2023-08-04 20:18:36.976781
descriptionA simple library to detect whether you are root/admin or not
homepage
repositoryhttps://gitlab.com/caralice/is-root
max_upload_size
id277181
size8,625
Alice Carroll (thecaralice)

documentation

README

is-root

Downloads License crates.io docs.rs Gitlab CI

A simple library to detect whether you are root/admin or not

Installation

Add is-root = "0.1.2" to [dependencies] section in your Cargo.toml

Usage

use is_root::is_root;

if is_root() {
    println!("Doing something dangerous")
} else {
    eprintln!("Run me as root")
}

You can find examples in examples directory

Commit count: 24

cargo fmt