Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ feat_os_unix_musl = [
"feat_require_unix_utmpx",
]
# "feat_os_windows" == set of utilities which can be built/run on modern windows platforms
feat_os_windows = ["feat_Tier1", "stdbuf"]
feat_os_windows = ["feat_Tier1", "stdbuf", "who"]
## (secondary platforms) feature sets
# "feat_os_unix_gnueabihf" == set of utilities which can be built/run on the "arm-unknown-linux-gnueabihf" target (ARMv6 Linux [hardfloat])
feat_os_unix_gnueabihf = [
Expand Down
14 changes: 13 additions & 1 deletion src/uu/who/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,21 @@ doctest = false

[dependencies]
clap = { workspace = true }
fluent = { workspace = true }
time = { workspace = true, features = ["formatting", "local-offset"] }

[target.'cfg(unix)'.dependencies]
rustix = { workspace = true, features = ["fs", "termios"] }
uucore = { workspace = true, features = ["utmpx"] }
fluent = { workspace = true }

[target.'cfg(windows)'.dependencies]
dns-lookup = { workspace = true }
uucore = { workspace = true }
windows-sys = { workspace = true, features = [
"Win32_Foundation",
"Win32_System_RemoteDesktop",
"Win32_System_Threading",
] }

[lints]
workspace = true
Expand Down
11 changes: 6 additions & 5 deletions src/uu/who/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

#[cfg(not(target_os = "openbsd"))]
#[cfg(all(unix, not(target_os = "openbsd")))]
mod unix;
#[cfg(not(target_os = "openbsd"))]
pub use self::unix::*;
#[cfg(all(unix, not(target_os = "openbsd")))]
pub(crate) use unix::*;

#[cfg(windows)]
mod windows;

#[cfg(target_os = "openbsd")]
mod openbsd;
#[cfg(target_os = "openbsd")]
pub use self::openbsd::*;
16 changes: 10 additions & 6 deletions src/uu/who/src/platform/openbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@

// Specific implementation for OpenBSD: tool unsupported (utmpx not supported)

use crate::uu_app;

use crate::Who;
use uucore::error::UResult;
use uucore::translate;

pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let _matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
println!("{}", translate!("who-unsupported-openbsd"));
Ok(())
impl Who {
#[allow(
clippy::unnecessary_wraps,
reason = "signature shared across platforms"
)]
pub(crate) fn exec(&mut self) -> UResult<()> {
println!("{}", translate!("who-unsupported-openbsd"));
Ok(())
}
}
Loading
Loading