From 0e14e1ded08b3232b7c936ce157f61e059379d42 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Fri, 19 Aug 2022 12:30:31 +0200 Subject: [PATCH] stty: add cfg guards for flags that don't exist on BSD fix another flag --- src/uu/stty/src/flags.rs | 134 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) diff --git a/src/uu/stty/src/flags.rs b/src/uu/stty/src/flags.rs index ad24fef30..2c3f00eec 100644 --- a/src/uu/stty/src/flags.rs +++ b/src/uu/stty/src/flags.rs @@ -57,6 +57,7 @@ pub const INPUT_FLAGS: &[Flag] = &[ // Flag::new("iuclc", I::IUCLC), Flag::new("ixany", I::IXANY), Flag::new("imaxbel", I::IMAXBEL).sane(), + #[cfg(any(target_os = "android", target_os = "linux", target_os = "macos"))] Flag::new("iutf8", I::IUTF8), ]; @@ -73,23 +74,156 @@ pub const OUTPUT_FLAGS: &[Flag] = &[ Flag::new("onlcr", O::ONLCR).sane(), Flag::new("onocr", O::ONOCR), Flag::new("onlret", O::ONLRET), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new("ofill", O::OFILL), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new("ofdel", O::OFDEL), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("nl0", O::NL0, O::NLDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("nl1", O::NL1, O::NLDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("cr0", O::CR0, O::CRDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("cr1", O::CR1, O::CRDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("cr2", O::CR2, O::CRDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("cr3", O::CR3, O::CRDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("tab0", O::TAB0, O::TABDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("tab1", O::TAB1, O::TABDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("tab2", O::TAB2, O::TABDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("tab3", O::TAB3, O::TABDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("bs0", O::BS0, O::BSDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("bs1", O::BS1, O::BSDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("vt0", O::VT0, O::VTDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("vt1", O::VT1, O::VTDLY), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("ff0", O::FF0, O::FFDLY).sane(), + #[cfg(any( + target_os = "android", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos" + ))] Flag::new_grouped("ff1", O::FF1, O::FFDLY), ];