Skip to content

Commit 0b7e4b1

Browse files
committed
stty/flags: List all missing flags that GNU version supports
List the remaining flags that GNU stty support, they cannot be be listed yet since we have no nix support for them, but it's better to keep the lists in sync so that it's easier to enable what will be supported in future
1 parent 14ef9bd commit 0b7e4b1

1 file changed

Lines changed: 43 additions & 1 deletion

File tree

src/uu/stty/src/flags.rs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// spell-checker:ignore lnext rprnt susp dsusp swtch vdiscard veof veol verase vintr vkill vlnext vquit vreprint vstart vstop vsusp vswtc vwerase werase VDSUSP
1111
// spell-checker:ignore sigquit sigtstp
1212
// spell-checker:ignore cbreak decctlq evenp litout oddp
13+
// spell-checker:ignore cdtrdsr CDTRDSR ofill OFILL dsusp VDSUSP VFLUSHO VSTATUS noncanonical VMIN deciseconds noncanonical VTIME
1314

1415
use crate::Flag;
1516

@@ -65,10 +66,14 @@ pub const CONTROL_FLAGS: &[Flag<C>] = &[
6566
Flag::new_grouped("cs7", C::CS7, C::CSIZE),
6667
Flag::new_grouped("cs8", C::CS8, C::CSIZE).sane(),
6768
Flag::new("hupcl", C::HUPCL),
69+
// Not supported by nix and libc.
70+
// Flag::new("hup", C::HUP).hidden(),
6871
Flag::new("cstopb", C::CSTOPB),
6972
Flag::new("cread", C::CREAD).sane(),
7073
Flag::new("clocal", C::CLOCAL),
7174
Flag::new("crtscts", C::CRTSCTS),
75+
// Not supported by nix and libc.
76+
// Flag::new("cdtrdsr", C::CDTRDSR),
7277
];
7378

7479
pub const INPUT_FLAGS: &[Flag<I>] = &[
@@ -120,6 +125,16 @@ pub const OUTPUT_FLAGS: &[Flag<O>] = &[
120125
target_os = "linux",
121126
target_os = "macos"
122127
))]
128+
// Not supported by nix.
129+
// See: https://github.com/nix-rust/nix/pull/2701
130+
// Flag::new("ofill", O::OFILL),
131+
// #[cfg(any(
132+
// target_os = "android",
133+
// target_os = "haiku",
134+
// target_os = "ios",
135+
// target_os = "linux",
136+
// target_os = "macos"
137+
// ))]
123138
Flag::new_grouped("nl0", O::NL0, O::NLDLY).sane(),
124139
#[cfg(any(
125140
target_os = "android",
@@ -253,7 +268,15 @@ pub const LOCAL_FLAGS: &[Flag<L>] = &[
253268
Flag::new("echok", L::ECHOK).sane(),
254269
Flag::new("echonl", L::ECHONL),
255270
Flag::new("noflsh", L::NOFLSH),
256-
// Not supported by nix
271+
// Not supported by nix and libc:
272+
// - https://github.com/rust-lang/libc/pull/4847
273+
// - https://github.com/nix-rust/nix/pull/2703
274+
// #[cfg(any(
275+
// target_os = "aix",
276+
// target_os = "android",
277+
// target_os = "haiku",
278+
// target_os = "linux",
279+
// ))]
257280
// Flag::new("xcase", L::XCASE),
258281
Flag::new("tostop", L::TOSTOP),
259282
Flag::new("echoprt", L::ECHOPRT),
@@ -377,6 +400,25 @@ pub const CONTROL_CHARS: &[(&str, S)] = &[
377400
("lnext", S::VLNEXT),
378401
// Discards the current line.
379402
("discard", S::VDISCARD),
403+
// deprecated compat option.
404+
// Not supported by nix and libc.
405+
// ("flush", S::VFLUSHO),
406+
#[cfg(any(
407+
target_os = "freebsd",
408+
target_os = "dragonfly",
409+
target_os = "ios",
410+
target_os = "macos",
411+
target_os = "netbsd",
412+
target_os = "openbsd",
413+
))]
414+
// Status character
415+
("status", S::VSTATUS),
416+
// Minimum number of characters for noncanonical read.
417+
// We handle this manually.
418+
// ("min", S::VMIN),
419+
// Timeout in deciseconds for noncanonical read.
420+
// We handle this manually.
421+
// ("time", S::VTIME),
380422
];
381423

382424
/// This constant lists all possible combination settings, using a bool to represent if the setting is negatable

0 commit comments

Comments
 (0)