Skip to content

Commit

Permalink
Switch from 'term' crate to 'termcolor' crate
Browse files Browse the repository at this point in the history
The `term` crate is unmaintained:

Stebalien/term#93
  • Loading branch information
tony-iqlusion committed May 25, 2019
1 parent a99b697 commit 1af607a
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 269 deletions.
33 changes: 26 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"
homepage = "https://github.com/iqlusioninc/abscissa/"
repository = "https://github.com/iqlusioninc/abscissa/tree/develop/"
readme = "README.md"
categories = ["command-line-interface", "rust-patterns", "web-programming"]
categories = ["command-line-interface", "rust-patterns"]
keywords = ["abscissa", "cli", "application", "framework", "service"]

[dependencies]
Expand All @@ -30,7 +30,7 @@ secrecy = { version = "0.1", optional = true }
semver = { version = "0.9", optional = true }
serde = { version = "1", optional = true, features = ["serde_derive"] }
simplelog = { version = "0.5", optional = true }
term = { version = "0.5", optional = true, default-features = false }
termcolor = { version = "1", optional = true }
toml = { version = "0.5", optional = true }

[dev-dependencies]
Expand All @@ -47,16 +47,12 @@ inflector = ["heck"]
logging = ["errors", "log", "simplelog"]
options = ["errors", "gumdrop", "gumdrop_derive"]
secrets = ["secrecy"]
shell = ["atty", "errors", "term"]
shell = ["atty", "errors", "termcolor"]
status = ["shell"]
time = ["chrono"]

[badges]
travis-ci = { repository = "iqlusioninc/abscissa", branch = "develop" }

[workspace]
members = [
".",
"abscissa_derive",
"abscissa_generator"
]
members = [".", "abscissa_derive", "abscissa_generator"]
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,13 @@ Here are all of Abscissa's transitive dependencies:
| 17 | [semver-parser] | [@steveklabnik] | Apache-2.0/MIT | no† | Parser for semver spec |
| 18 | [serde] | [serde-rs] | Apache-2.0/MIT | yes | Serialization framework |
| 19 | [simplelog] | [@drakulix] | Apache-2.0/MIT | yes | Simple logging facility |
| 20 | [term] | [@Stebalien] | Apache-2.0/MIT | yes‡ | Terminal color support |
| 20 | [termcolor] | [@BurntSushi] | MIT/Unlicense | no | Terminal color support |
| 21 | [time] | [rust-lang] | Apache-2.0/MIT | yes | Time/date library |
| 22 | [toml] | [@alexcrichton] | Apache-2.0/MIT | no | TOML parser library |
| 23 | [winapi]§ | [@retep998] | Apache-2.0/MIT | yes | Windows API bindings |
| 24 | [zeroize] | [iqlusion] | Apache-2.0 | yes | Zero out sensitive data |

*`semver-parser` has one usage of `unsafe` which is not compiled by Abscissa.
*`term` has one usage of unsafe on Windows. Other platforms do not use unsafe.
* § `winapi` also pulls in either [winapi-i686-pc-windows-gnu] or [winapi-x86_64-pc-windows-gnu]
which are omitted for brevity.

Expand Down Expand Up @@ -130,7 +129,6 @@ so you only compile the parts you need.
| [abscissa_derive] | mandatory | - | [abscissa] |
| [backtrace] | mandatory | - | [failure] |
| [backtrace-sys] | mandatory | - | [backtrace] |
| [byteorder] | `shell` | - | [term] |
| [canonical-path] | mandatory | - | [abscissa] |
| [cc] | mandatory | - | [backtrace-sys], [zeroize] |
| [cfg-if] | mandatory | - | [backtrace] |
Expand All @@ -139,7 +137,7 @@ so you only compile the parts you need.
| [failure_derive] | mandatory | - | [failure] |
| [atty] | `shell` | - | [abscissa] |
| [lazy_static] | mandatory | - | [abscissa] |
| [libc] | `shell` | `unix` | [atty] |
| [libc] | `shell` | `unix` | [atty] |
| [log] | `logging` | - | [abscissa] |
| [num-integer] | `logging` | - | [chrono] |
| [num-traits] | `logging` | - | [chrono], [num-integer] |
Expand All @@ -151,11 +149,11 @@ so you only compile the parts you need.
| [serde] | `config` | - | [abscissa] |
| [serde_derive] | `config` | - | [serde] |
| [simplelog] | `logging` | - | [abscissa] |
| [term] | `shell` | - | [abscissa] |
| [termcolor] | `shell` | - | [abscissa] |
| [time] | `logging` | - | [chrono] |
| [unicode-xid] | mandatory | - | [proc-macro2] |
| [version_check] | mandatory | - | [lazy_static] |
| [winapi]§ | `shell` | `windows` | [atty] |
| [winapi]§ | `shell` | `windows` | [atty] |
| [zeroize] | mandatory | - | [abscissa] |

* § `winapi` also pulls in either [winapi-i686-pc-windows-gnu] or [winapi-x86_64-pc-windows-gnu]
Expand Down Expand Up @@ -233,10 +231,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Parts of this code were taken from the [Cargo] project, which is
Copyright (c) 2014 The Rust Project Developers and also licensed
under the terms of the Apache License (Version 2.0).

## Contribution

Unless you explicitly state otherwise, any contribution intentionally
Expand Down Expand Up @@ -296,7 +290,7 @@ without any additional terms or conditions.
[simplelog]: https://crates.io/crates/simplelog
[syn]: https://crates.io/crates/syn
[synstructure]: https://crates.io/crates/
[term]: https://crates.io/crates/term
[termcolor]: https://crates.io/crates/termcolor
[time]: https://crates.io/crates/time
[toml]: https://crates.io/crates/toml
[unicode-xid]: https://crates.io/crates/unicode-xid
Expand All @@ -317,7 +311,6 @@ without any additional terms or conditions.
[@retep998]: https://github.com/retep998
[@SergioBenitez]: https://github.com/SergioBenitez
[@softprops]: https://github.com/softprops
[@Stebalien]: https://github.com/Stebalien
[@steveklabnik]: https://github.com/steveklabnik
[@withoutboats]: https://github.com/withoutboats
[chronotope]: https://github.com/chronotope/
Expand Down
16 changes: 8 additions & 8 deletions src/macros/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#[macro_export]
macro_rules! status {
($stream:expr, $color:expr, $status:expr, $msg:expr) => {
$crate::status($stream, $color, $status, $msg, true);
$crate::status($stream, $color, true, $status, $msg, true).unwrap();
};
($stream:expr, $color:expr, $status:expr, $fmt:expr, $($arg:tt)+) => {
$crate::status!($stream, $color, $status, format!($fmt, $($arg)+));
Expand All @@ -55,7 +55,7 @@ macro_rules! status {
#[macro_export]
macro_rules! status_nojust {
($stream:expr, $color:expr, $status:expr, $msg:expr) => {
$crate::status($stream, $color, $status, $msg, false);
$crate::status($stream, $color, true, $status, $msg, false).unwrap();
};
($stream:expr, $color:expr, $status:expr, $fmt:expr, $($arg:tt)+) => {
$crate::status!($stream, $color, $status, format!($fmt, $($arg)+));
Expand All @@ -74,7 +74,7 @@ macro_rules! status_nojust {
#[macro_export]
macro_rules! status_ok {
($status:expr, $msg:expr) => {
$crate::status!($crate::Stream::Stdout, $crate::shell::color::GREEN, $status, $msg);
$crate::status!($crate::Stream::Stdout, $crate::shell::Color::Green, $status, $msg);
};
($status:expr, $fmt:expr, $($arg:tt)+) => {
$crate::status_ok!($status, format!($fmt, $($arg)+));
Expand All @@ -93,7 +93,7 @@ macro_rules! status_ok {
#[macro_export]
macro_rules! status_info {
($status:expr, $msg:expr) => {
$crate::status!($crate::Stream::Stdout, $crate::shell::color::BRIGHT_CYAN, $status, $msg);
$crate::status!($crate::Stream::Stdout, $crate::shell::Color::Cyan, $status, $msg);
};
($status:expr, $fmt:expr, $($arg:tt)+) => {
$crate::status_info!($status, format!($fmt, $($arg)+));
Expand All @@ -112,7 +112,7 @@ macro_rules! status_info {
#[macro_export]
macro_rules! status_warn {
($msg:expr) => {
$crate::status_nojust!($crate::Stream::Stdout, $crate::shell::color::YELLOW, "warning:", $msg);
$crate::status_nojust!($crate::Stream::Stdout, $crate::shell::Color::Yellow, "warning:", $msg);
};
($fmt:expr, $($arg:tt)+) => {
$crate::status_warn!(format!($fmt, $($arg)+));
Expand All @@ -131,7 +131,7 @@ macro_rules! status_warn {
#[macro_export]
macro_rules! status_err {
($msg:expr) => {
$crate::status_nojust!($crate::Stream::Stderr, $crate::shell::color::RED, "error:", $msg);
$crate::status_nojust!($crate::Stream::Stderr, $crate::shell::Color::Red, "error:", $msg);
};
($fmt:expr, $($arg:tt)+) => {
$crate::status_err!(format!($fmt, $($arg)+));
Expand Down Expand Up @@ -173,7 +173,7 @@ macro_rules! status_attr {
#[macro_export]
macro_rules! status_attr_ok {
($attr:expr, $msg:expr) => {
$crate::status_attr!($crate::Stream::Stdout, $crate::shell::color::GREEN, $attr, $msg);
$crate::status_attr!($crate::Stream::Stdout, $crate::shell::Color::Green, $attr, $msg);
};
($attr: expr, $fmt:expr, $($arg:tt)+) => {
$crate::status_attr_ok!($attr, format!($fmt, $($arg)+));
Expand All @@ -192,7 +192,7 @@ macro_rules! status_attr_ok {
#[macro_export]
macro_rules! status_attr_err {
($attr:expr, $msg:expr) => {
$crate::status_attr!($crate::Stream::Stderr, $crate::shell::color::RED, $attr, $msg);
$crate::status_attr!($crate::Stream::Stderr, $crate::shell::Color::Red, $attr, $msg);
};
($attr: expr, $fmt:expr, $($arg:tt)+) => {
$crate::status_attr_err!($attr, format!($fmt, $($arg)+));
Expand Down
Loading

0 comments on commit 1af607a

Please sign in to comment.