gecko-dev/third_party/rust/term_size
Manish Goregaokar 6029c24c9d Bug 1341102: Revendor rust dependencies; r=bustage
MozReview-Commit-ID: 7hXRyaLssOZ


--HG--
rename : third_party/rust/cssparser/src/macros/match_byte.rs => third_party/rust/cssparser/build/match_byte.rs
2017-02-28 09:23:59 -08:00
..
src
.cargo-checksum.json
.cargo-ok
.clog.toml
.gitignore
.travis.yml
CHANGELOG.md
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md
appveyor.yml
index.html
justfile
rustfmt.toml

README.md

term_size

Crates.io Crates.io license license Coverage Status Join the chat at https://gitter.im/kbknapp/term_size-rs

Linux: Build Status Windows: Build status

A Rust library to enable getting terminal sizes and dimensions

Documentation

Usage

First, add the following to your Cargo.toml:

[dependencies]
term_size = "0.1"

Next, add this to your crate root:

extern crate term_size;

To get the dimensions of your terminal window, simply use the following:

fn main() {
  if let Some((w, h)) = term_size::dimensions() {
    println!("Width: {}\nHeight: {}", w, h);
  } else {
    println!("Unable to get term size :(")
  }
}

License

Copyright Benjamin Sago, Kevin Knapp, and term_size contributors.

Licensed under either of

at your option.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.