aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml7
-rw-r--r--LICENSE32
-rw-r--r--README.md22
-rw-r--r--src/lib.rs3
4 files changed, 64 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a1d2b8e..1c42d46 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,6 +4,13 @@ version = "0.1.0"
authors = ["Jesse Luehrs <doy@tozt.net>"]
edition = "2018"
+description = "a stream of terminal resize events"
+license = "MIT"
+repository = "https://git.tozt.net/tokio-terminal-resize"
+readme = "README.md"
+keywords = ["terminal", "size", "sigwinch"]
+categories = ["asynchronous"]
+
[dependencies]
futures = "0.1.29"
snafu = { version = "0.5", features = ["futures-01"] }
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..fda0fd2
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,32 @@
+This software is Copyright (c) 2019 by Jesse Luehrs.
+
+This is free software, licensed under:
+
+ The MIT (X11) License
+
+The MIT License
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the Software
+without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to
+whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
+WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..b12b1f1
--- /dev/null
+++ b/README.md
@@ -0,0 +1,22 @@
+# tokio-terminal-resize
+
+Implements a stream of terminal resize events.
+
+## Overview
+
+Whenever the user resizes their terminal, a notification is sent to the
+application running in it. This crate provides those notifications in the
+form of a stream.
+
+## Synopsis
+
+```rust
+let stream = tokio_terminal_resize::resizes().flatten_stream();
+let prog = stream
+ .for_each(|(rows, cols)| {
+ println!("terminal is now {}x{}", cols, rows);
+ Ok(())
+ })
+ .map_err(|e| eprintln!("error: {}", e));
+tokio::run(prog);
+```
diff --git a/src/lib.rs b/src/lib.rs
index 0a58daa..c29c822 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,8 +21,11 @@
//! tokio::run(prog);
//! ```
+// XXX this is broken with ale
+// #![warn(clippy::cargo)]
#![warn(clippy::pedantic)]
#![warn(clippy::nursery)]
+#![allow(clippy::multiple_crate_versions)]
use futures::future::Future as _;
use futures::stream::Stream as _;