All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- WASI support
- Fallible functions
whoami::fallible::devicename()
whoami::fallible::devicename_os()
whoami::fallible::distro()
whoami::fallible::hostname()
- notably doesn't normalize to lowercasewhoami::fallible::realname()
whoami::fallible::realname_os()
whoami::fallible::username()
whoami::fallible::username_os()
whoami::langs()
Language
Country
- Generated device names that infer casing based on the hostname when the device name is not available - now returns the hostname unchanged
- Deprecated
whoami::distro_os()
- Deprecated
whoami::hostname()
- Deprecated
whoami::hostname_os()
- Deprecated
whoami::lang()
- Removed some unnecessary allocations
- Rare and nearly impossible cases of undefined behavior
- Better handling of UTF-8 non-conformant strings
- License files not being included in package on crates.io
- Support for Illumos
Arch
enum listing CPU architecturesWidth
enum listing CPU architecture address widthsarch()
function which returns anArch
type representing a CPU architectureArch::width()
method which returns the address width of a CPU architectureweb
feature (enabled by default). Disabling this feature allows you to use wasm32-unknown-unknown with whoami outside of the browser with a mock implementation.- Officially support compiling to WASI or Daku WebAssembly platforms; functionality not supported yet.
- Convenience
Result
type alias.
- Modernized and cleaned up code style
- Handling of
lang()
when$LANG
environment variable on unix set to "C", causing duplicated iterator elements["C", "C"]
; now produces["en-US"]
. - WhoAmI reporting "Safari" when running in Chrome/Chromium browser
- WhoAmI reporting "Edg" when running in Edge browser (now reports "Edge")
- WhoAmI reporting "OPR" when running in Opera browser (now reports "Opera")
- WhoAmI reporting "Mozilla" when running in GNOME web browser (now reports "GNOME Web")
- WebAssembly target requiring older versions of dependencies
- More details to the method documentation
- WhoAmI now has an official MSRV of Rust 1.40.0
whoami::hostname()
is now normalized to lowercase
- The Windows GNU target support being broken
- Derives for
Clone
,PartialEq
andEq
onDesktopEnv
andPlatform
- Lower MSRV for Windows
- Segfault that occurs when passwd entry missing in docker
- There are no longer any known panics within the code, all possible panics with whoami are now considered bugs.
- If any of the primary functions return an empty string, whoami should now
return "Unknown" or"unknown", or for
hostname()
, "localhost".
- Panicking in situations where certain files don't exist / OS functions fail.
- Circumstance where whoami points to invalid memory on Linux.
- Not parsing the gecos field properly on unix systems (affects the
realname()
andrealname_os()
functions; they will no longer return extraneous commas on some systems).
- Not compiling on target
x86_64-pc-windows-gnu
.
lang()
function which returns an iterator over user's preferred language(s)
- Link to logo in documentation.
distro()
on Windows now returns more detailed version.
- Official support for BSD and variants
platform()
will now returnPlatform::Bsd
when running BSD.- Misaligned address error on FreeBSD when calling
username()
.
Platform::Dive
andDesktopEnv::Dive
, as that was an OS idea not a real OS- Explicit support for
stdweb
, now built onweb-sys
/wasm-bindgen
.
stdweb
andwasm-bindgen
support- Versions of
-> String
functions that returnOsString
s:devicename_os()
distro_os()
hostname_os()
realname_os()
username_os()
- Renamed
DesktopEnv::Mac
toDesktopEnv::Aqua
- Renamed
DesktopEnv::Wasm
toDesktopEnv::WebBrowser
- Renamed
DesktopEnv::Redox
toDesktopEnv::Orbital
- Renamed
DesktopEnv::Fuchsia
toDesktopEnv::Ermine
- Renamed
Platform::FreeBsd
toPlatform::Bsd
- Renamed
env()
todesktop_env()
- Renamed
host()
todevicename()
- Renamed
os()
todistro()
- Renamed
user()
torealname()
- Inconsistencies on Windows
- MacOS running commands instead of using native APIs (this results in speed improvements on MacOS)
- One of the Linux functions also using commands instead of native APIs (faster)
Thanks to everyone who contributed to make this version of whoami possible!
- Windows
host()
andhostname()
now behave like they do on Linux and MacOS
- Windows FFI Undefined Behavior because of not checking for errors
- Cross-compiling from Linux to Windows not working
- Remove unnecessary use of
to_mut()
onCow
s returned fromString::from_utf8_lossy()
.
- Detection for KDE desktop environment.
- Unknown desktop environment may now contain lowercase characters.
- No longer unwraps in any place where bad data from the OS could cause a panic.
stdweb
dependency when targetting web assembly.
- All public enums now have the attribute
#[non_exhaustive]
and deriveDebug
.
- Some out-of-date documentation
- Web Assembly support.
Platform::Web
variant of enum, useenv()
if you need to.
platform()
is no longer a const fn (needed for wasm platform detection).
- Now uses a more modern Rust coding style (replace
::std::
withstd::
). - Now uses a more modern Rust coding style with
mem::MaybeUninit
. impl Display
for desktop environment now uses proper capitalization.- Don't depend on
libc
anymore.
- Fancy Names not working on Windows
user()
now uses Windows Display Name on Windows rather than the username.host()
now uses Windows Name DNS Fully Qualified rather than the hostname.
- Fixed more broken links!
- Clippy lint warning: change
expect(&format!("…"))
toexpect("…")
for optimization in 2 cases. - Fixed broken links
Platform
enum with correspondingplatform()
function.Dive
,Fuchsia
, andRedox
toDesktopEnv
enum.
- Started using
const fn
for some functions.
- Fixed README errors.
- MacOS support.
env
on Ubuntu now returnsDesktopEnv::Ubuntu
instead ofDesktopEnv::Other("UBUNTU")
- Split off the binary into
whome
(who me?) crate
- Added more fallbacks.
- Rename realname -> user
- Rename computer -> host
- Fix typo for uknown -> unknown.
- Works now on platforms that use u8 instead of i8 for chars (like ARM).
- Trailing newline on Windows.
- Typo in markdown.
- Undefined behavior on Linux.
- Windows support.
- Something in the markdown.
- Published to crates.io.