From 48bdb1928357320a8aaefee6958db7f6edc45277 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Thu, 8 May 2025 16:51:39 +0200 Subject: [PATCH] mesg: move uu_app() to bottom of file --- src/uu/mesg/src/mesg.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/uu/mesg/src/mesg.rs b/src/uu/mesg/src/mesg.rs index 220ed36..941cb64 100644 --- a/src/uu/mesg/src/mesg.rs +++ b/src/uu/mesg/src/mesg.rs @@ -68,6 +68,17 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { Ok(()) } +#[cfg(not(target_family = "unix"))] +#[uucore::main] +pub fn uumain(args: impl uucore::Args) -> UResult<()> { + let _matches: ArgMatches = uu_app().try_get_matches_from(args)?; + + Err(uucore::error::USimpleError::new( + 1, + "`mesg` is available only on Unix platforms.", + )) +} + pub fn uu_app() -> Command { Command::new(uucore::util_name()) .version(crate_version!()) @@ -88,14 +99,3 @@ pub fn uu_app() -> Command { .action(ArgAction::Set), ) } - -#[cfg(not(target_family = "unix"))] -#[uucore::main] -pub fn uumain(args: impl uucore::Args) -> UResult<()> { - let _matches: ArgMatches = uu_app().try_get_matches_from(args)?; - - Err(uucore::error::USimpleError::new( - 1, - "`mesg` is available only on Unix platforms.", - )) -}