From c49769865a1e9b894880a6904a20009dace84c50 Mon Sep 17 00:00:00 2001 From: m11o Date: Thu, 27 Apr 2023 22:14:52 +0900 Subject: [PATCH 1/2] stty: move help strings to markdown file --- src/uu/stty/src/stty.rs | 9 +++------ src/uu/stty/stty.md | 9 +++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 src/uu/stty/stty.md diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index 928c3f177..19340830d 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -18,7 +18,7 @@ use std::ops::ControlFlow; use std::os::unix::fs::OpenOptionsExt; use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; use uucore::error::{UResult, USimpleError}; -use uucore::format_usage; +use uucore::{format_usage, help_usage, help_about}; #[cfg(not(any( target_os = "freebsd", @@ -31,11 +31,8 @@ use uucore::format_usage; use flags::BAUD_RATES; use flags::{CONTROL_FLAGS, INPUT_FLAGS, LOCAL_FLAGS, OUTPUT_FLAGS}; -const USAGE: &str = "\ - {} [-F DEVICE | --file=DEVICE] [SETTING]... - {} [-F DEVICE | --file=DEVICE] [-a|--all] - {} [-F DEVICE | --file=DEVICE] [-g|--save]"; -const SUMMARY: &str = "Print or change terminal characteristics."; +const USAGE: &str = help_usage!("stty.md"); +const SUMMARY: &str = help_about!("stty.md"); #[derive(Clone, Copy, Debug)] pub struct Flag { diff --git a/src/uu/stty/stty.md b/src/uu/stty/stty.md new file mode 100644 index 000000000..6aa1decf5 --- /dev/null +++ b/src/uu/stty/stty.md @@ -0,0 +1,9 @@ +# stty + +``` +stty [-F DEVICE | --file=DEVICE] [SETTING]... +stty [-F DEVICE | --file=DEVICE] [-a|--all] +stty [-F DEVICE | --file=DEVICE] [-g|--save] +``` + +Print or change terminal characteristics. From 0391239273d1ec98c64330df84095ab4e5fb21f9 Mon Sep 17 00:00:00 2001 From: m11o Date: Thu, 27 Apr 2023 22:17:37 +0900 Subject: [PATCH 2/2] fix cargo fmt --- src/uu/stty/src/stty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index 19340830d..e09662471 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -18,7 +18,7 @@ use std::ops::ControlFlow; use std::os::unix::fs::OpenOptionsExt; use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; use uucore::error::{UResult, USimpleError}; -use uucore::{format_usage, help_usage, help_about}; +use uucore::{format_usage, help_about, help_usage}; #[cfg(not(any( target_os = "freebsd",