Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement OS Family feature #313

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
8 changes: 4 additions & 4 deletions os_info/src/family.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ pub enum Family {
/// Apple's MacOS
/// https://en.wikipedia.org/wiki/Macintosh_operating_systems
MacOS,
/// NT based operatings system
/// https://en.wikipedia.org/wiki/Windows_NT
WindowsNT,
/// SunOS and OSs derived from SunOS such as Illumos
/// https://en.wikipedia.org/wiki/SunOS
SunOS,
/// Operating systems whose family is unknown
Unknown,
/// Operating systems that are DOS or derived from DOS
/// https://en.wikipedia.org/wiki/Disk_operating_system
DOS,
}

impl Default for Family {
Expand All @@ -40,7 +40,7 @@ impl Display for Family {
Family::Linux => write!(f, "Linux"),
Family::MacOS => write!(f, "MacOS"),
Family::SunOS => write!(f, "SunOS"),
Family::DOS => write!(f, "DOS"),
Family::WindowsNT => write!(f, "Windows NT"),
_ => write!(f, "{:?}", self),
}
}
Expand Down
2 changes: 1 addition & 1 deletion os_info/src/redox/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn current_platform() -> Info {
os_type: Type::Redox,
version,
bitness: Bitness::Unknown,
family: Family::DOS,
family: Family::WindowsNT,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also seems weird to me. 🙃

Copy link
Contributor Author

@martintc martintc Jun 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this one, @kraileth suggested changing since Windows is no longer truly "DOS," and I guess that has been true since the 90s. So calling it in the "DOS" family is misleading. He recommended changing it to either something NT since NT is the kernel architecture or just having the family also be Windows. I don't really know enough about Windows and its architecture to really know either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought here: the OS enviroment variable expands to Windows_NT on windows systems

..Default::default()
};
trace!("Returning {:?}", info);
Expand Down
2 changes: 1 addition & 1 deletion os_info/src/windows/winapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn get() -> Info {
version,
edition,
bitness: bitness(),
family: Family::DOS,
family: Family::WindowsNT,
..Default::default()
}
}
Expand Down