diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/termize/src/lib.rs | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/termize/src/lib.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/termize/src/lib.rs b/vendor/termize/src/lib.rs new file mode 100644 index 000000000..87be69413 --- /dev/null +++ b/vendor/termize/src/lib.rs @@ -0,0 +1,34 @@ +//! System calls for getting the terminal size. +//! +//! Getting the terminal size is performed using an ioctl command that takes +//! the file handle to the terminal -- which in this case, is stdout -- and +//! populates a structure containing the values. +//! +//! The size is needed when the user wants the output formatted into columns: +//! the default grid view, or the hybrid grid-details view. +//! +//! # Example +//! +//! To get the dimensions of your terminal window, simply use the following: +//! +//! ```no_run +//! if let Some((w, h)) = termize::dimensions() { +//! println!("Width: {}\nHeight: {}", w, h); +//! } else { +//! println!("Unable to get term size :("); +//! } +//! ``` +#![deny( + missing_docs, + missing_debug_implementations, + missing_copy_implementations, + trivial_casts, + unused_import_braces, + unused_allocation, + unused_qualifications, + trivial_numeric_casts +)] + +// A facade to allow exposing functions depending on the platform +mod platform; +pub use crate::platform::{dimensions, dimensions_stderr, dimensions_stdin, dimensions_stdout}; |