1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

refactor/uname ~ use platform_info-v1.0.2

This commit is contained in:
Roy Ivy III 2023-01-03 21:08:20 -06:00
parent 6a9660f9f6
commit 10f35fc282
2 changed files with 2 additions and 23 deletions

View file

@ -15,7 +15,7 @@ edition = "2021"
path = "src/uname.rs"
[dependencies]
platform-info = "1.0.1"
platform-info = "1.0.2"
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
uucore = { version=">=0.0.16", package="uucore", path="../../uucore" }

View file

@ -33,27 +33,6 @@ pub mod options {
pub static OS: &str = "operating-system";
}
#[cfg(all(target_os = "linux", any(target_env = "gnu", target_env = "")))]
const HOST_OS: &str = "GNU/Linux";
#[cfg(all(target_os = "linux", not(any(target_env = "gnu", target_env = ""))))]
const HOST_OS: &str = "Linux";
#[cfg(target_os = "android")]
const HOST_OS: &str = "Android";
#[cfg(target_os = "windows")]
const HOST_OS: &str = "Windows NT";
#[cfg(target_os = "freebsd")]
const HOST_OS: &str = "FreeBSD";
#[cfg(target_os = "netbsd")]
const HOST_OS: &str = "NetBSD";
#[cfg(target_os = "openbsd")]
const HOST_OS: &str = "OpenBSD";
#[cfg(target_vendor = "apple")]
const HOST_OS: &str = "Darwin";
#[cfg(target_os = "fuchsia")]
const HOST_OS: &str = "Fuchsia";
#[cfg(target_os = "redox")]
const HOST_OS: &str = "Redox";
#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let matches = uu_app().try_get_matches_from(args)?;
@ -108,7 +87,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}
if os || all {
output.push_str(HOST_OS);
output.push_str(&uname.osname());
output.push(' ');
}