Skip to content

Commit 319d4b4

Browse files
Merge pull request #30 from iqlusion-io/iq-cli
iq-cli: Initial crate
2 parents 49f312b + 19e9f14 commit 319d4b4

File tree

7 files changed

+309
-10
lines changed

7 files changed

+309
-10
lines changed

Cargo.lock

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[workspace]
22
members = [
33
"canonical-path",
4+
"iq-cli",
45
"rpmlib",
56
"rpmlib-sys",
67
"tai64"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ This repository contains the following crates:
2424

2525
* [canonical-path:](https://github.com/iqlusion-io/crates/tree/master/canonical-path)
2626
`Path` and `PathBuf`-like types for representing canonical filesystem paths.
27+
* [iq-cli:](https://github.com/iqlusion-io/crates/tree/master/iq-cli)
28+
Cargo-like colored command-line interfaces.
2729
* [rpmlib:](https://github.com/iqlusion-io/crates/tree/master/rpmlib)
2830
Rust binding to rpmlib (RPM Package Manager library)
2931
* [rpmlib-sys:](https://github.com/iqlusion-io/crates/tree/master/rpmlib-sys)

iq-cli/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "iq-cli"
3+
description = "Cargo-like colored command-line interfaces"
4+
version = "0.0.0" # Also update html_root_url in lib.rs when bumping this
5+
authors = ["Tony Arcieri <[email protected]>"]
6+
homepage = "https://github.com/iqlusion-io/crates/"
7+
repository = "https://github.com/iqlusion-io/crates/tree/master/iq-cli"
8+
readme = "README.md"
9+
categories = ["command-line-interface"]
10+
keywords = ["cli", "color"]
11+
12+
[badges]
13+
circle-ci = { repository = "iqlusion-io/crates" }
14+
15+
[dependencies]
16+
libc = "0.2"
17+
term = "0.5"

iq-cli/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# iq-cli: Crate for making Cargo-like command-line interfaces
2+
3+
[![Crate][crate-image]][crate-link]
4+
[![Docs][docs-image]][docs-link]
5+
[![Build Status][build-image]][build-link]
6+
[![Apache 2.0 Licensed][license-image]][license-link]
7+
8+
[crate-image]: https://img.shields.io/crates/v/iq-cli.svg
9+
[crate-link]: https://crates.io/crates/iq-cli
10+
[docs-image]: https://docs.rs/iq-cli/badge.svg
11+
[docs-link]: https://docs.rs/iq-cli/
12+
[build-image]: https://circleci.com/gh/iqlusion-io/crates.svg?style=shield
13+
[build-link]: https://circleci.com/gh/iqlusion-io/crates
14+
[license-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg
15+
[license-link]: https://github.com/iqlusion-io/crates/blob/master/LICENSE
16+
17+
This crate contains reusable components for building Cargo-like command-line
18+
interfaces which can selectively enable colored output when a TTY is available.
19+
20+
## License
21+
22+
The **iq-cli** crate is distributed under the terms of the
23+
Apache License (Version 2.0).
24+
25+
Parts of this code were taken from the [Cargo](https://github.com/rust-lang/cargo)
26+
project, which is copyright The Rust Project Developers, and dual licensed under
27+
the MIT and Apache 2.0 licenses. However, at least for now we are only making
28+
our codebase available under the Apache 2.0 license.
29+
30+
See [LICENSE] file in the `iqlusion-io/crates` toplevel directory for more
31+
information.
32+
33+
[LICENSE]: https://github.com/iqlusion-io/crates/blob/master/LICENSE

iq-cli/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//! Cargo-like command-line interfaces with selectively-colored status output
2+
3+
#![crate_name = "iq_cli"]
4+
#![crate_type = "rlib"]
5+
#![deny(warnings, missing_docs, unsafe_code, unused_import_braces, unused_qualifications)]
6+
#![doc(html_root_url = "https://docs.rs/iq-cli/0.0.0")]
7+
8+
extern crate libc;
9+
extern crate term;
10+
11+
mod shell;
12+
13+
pub use shell::{create, ColorConfig, Shell, ShellConfig};
14+
pub use term::color;
15+
pub use term::color::Color;

0 commit comments

Comments
 (0)