Crates.io | os_info_cli |
lib.rs | os_info_cli |
version | 2.0.0 |
source | src |
created_at | 2020-05-09 21:44:25.132078 |
updated_at | 2022-02-04 13:02:58.49073 |
description | Detect the operating system type and version. |
homepage | https://github.com/stanislav-tkach/os_info |
repository | https://github.com/stanislav-tkach/os_info |
max_upload_size | |
id | 239409 |
size | 21,512 |
This project consists of two parts: the library that can be used to detect the operating system type (including version and bitness) and the command line tool that uses the library.
os_info
)os_info
usageTo use this crate, add os_info
as a dependency to your project's Cargo.toml:
[dependencies]
os_info = "3"
This project has serde
as an optional dependency, so if you don't need it, then
you can speed up compilation disabling it:
[dependencies]
os_info = { version = "3", default-features = false }
let info = os_info::get();
// Print full information:
println!("OS information: {}", info);
// Print information separately:
println!("Type: {}", info.os_type());
println!("Version: {}", info.version());
println!("Bitness: {}", info.bitness());
os_info_cli
)A simple wrapper around the os_info
library.
This tool can be installed using the following cargo command:
cargo install os_info_cli
os_info_cli
usageDespite being named os_info_cli
during installation, it is actually named
os_info
. You can use the --help
flag to see available options:
os_info --help
Right now, the following operating system types can be returned:
If you need support for more OS types, I am looking forward to your Pull Request.
os_info
is licensed under the MIT license. See LICENSE for the details.