Skip to content

Commit

Permalink
Fix argument parsing and update deps (#114)
Browse files Browse the repository at this point in the history
Resolves #110
  • Loading branch information
lhvy committed Apr 11, 2023
1 parent 5c532ae commit 52432d0
Show file tree
Hide file tree
Showing 12 changed files with 486 additions and 412 deletions.
584 changes: 395 additions & 189 deletions Cargo.lock

Large diffs are not rendered by default.

176 changes: 0 additions & 176 deletions LICENSE-APACHE

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE-MIT

This file was deleted.

55 changes: 55 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Blue Oak Model License

Version 1.0.0

## Purpose

This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.

## Acceptance

In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.

## Copyright

Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.

## Notices

You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.

## Excuse

If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.

## Patent

Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.

## Reliability

No contributor can revoke this license.

## No Liability

**_As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim._**
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ There are also command line options that can be used to override parts of the co

### Contributors

pipes-rs is maintained by [lhvy](https://github.com/lhvy) and [arzg](https://github.com/arzg); any other contributions via PRs are welcome! Forks and modifications are implicitly dual-licensed under Apache 2.0 OR MIT. Please credit the above contributors and pipes.sh when making modifications.
pipes-rs is maintained by [lhvy](https://github.com/lhvy) and [lunacookies](https://github.com/lunacookies); any other contributions via PRs are welcome! Forks and modifications are implicitly licensed under the Blue Oak Model License 1.0.0. Please credit the above contributors and pipes.sh when making forks or other derivative works.

### Inspiration

Expand Down
6 changes: 3 additions & 3 deletions crates/model/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
edition = "2021"
license = "MIT OR Apache-2.0"
license = "BlueOak-1.0.0"
name = "model"
version = "0.0.0"

[dependencies]
anyhow = "1.0"
anyhow = "1.0.70"
rng = {path = "../rng"}
serde = {version = "1.0", features = ["derive"]}
serde = {version = "1.0.159", features = ["derive"]}
terminal = {path = "../terminal"}
tincture = "1.0.0"
6 changes: 4 additions & 2 deletions crates/model/src/pipe/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl FromStr for ColorMode {
"ansi" => Self::Ansi,
"rgb" => Self::Rgb,
"none" => Self::None,
_ => anyhow::bail!("unknown color mode"),
_ => anyhow::bail!(r#"unknown color mode (expected “ansi”, “rgb”, or “none”)"#),
})
}
}
Expand All @@ -121,7 +121,9 @@ impl FromStr for Palette {
"darker" => Self::Darker,
"pastel" => Self::Pastel,
"matrix" => Self::Matrix,
_ => anyhow::bail!("unknown palette"),
_ => anyhow::bail!(
r#"unknown palette (expected “default”, “darker”, “pastel”, or “matrix”)"#
),
})
}
}
Expand Down
13 changes: 7 additions & 6 deletions crates/pipes-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
[package]
description = "An over-engineered rewrite of pipes.sh in Rust"
edition = "2021"
license = "MIT OR Apache-2.0"
license = "BlueOak-1.0.0"
name = "pipes-rs"
version = "1.6.1"

[dependencies]
anyhow = "1.0"
clap = { version = "4.0.7", features = ["derive", "wrap_help"] }
anyhow = "1.0.70"
clap = { version = "4.2.1", features = ["derive", "help", "wrap_help"] }
etcetera = "0.4.0"
mimalloc = { version = "0.1.25", default-features = false }
mimalloc = { version = "0.1.36", default-features = false }
model = { path = "../model" }
rng = { path = "../rng" }
serde = "1.0"
serde = "1.0.159"
terminal = { path = "../terminal" }
toml = "0.5.8"
toml = "0.7.3"

[dev-dependencies]
criterion = "0.4.0"
Expand Down
14 changes: 9 additions & 5 deletions crates/pipes-rs/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ use std::path::PathBuf;
use std::time::Duration;

#[derive(Serialize, Deserialize, Default, Parser)]
#[command(name = "pipes-rs", version)]
#[command(
name = "pipes-rs",
version,
about = "An over-engineered rewrite of pipes.sh in Rust.\nLicensed under the Blue Oak Model License 1.0.0. See https://blueoakcouncil.org/license/1.0.0 for more information."
)]
pub struct Config {
/// what kind of terminal coloring to use
#[arg(short, long, value_parser = ["ansi", "rgb", "none"])]
#[arg(short, long)]
pub color_mode: Option<ColorMode>,

/// the color palette used assign colors to pipes
#[arg(long, value_parser = ["default", "darker", "pastel", "matrix"])]
#[arg(long)]
pub palette: Option<Palette>,

/// cycle hue of pipes
Expand All @@ -35,11 +39,11 @@ pub struct Config {
pub kinds: Option<KindSet>,

/// whether to use bold
#[arg(short, long, value_parser = ["true", "false"], value_name = "BOOL")]
#[arg(short, long, value_name = "BOOL")]
pub bold: Option<bool>,

/// whether pipes should retain style after hitting the edge
#[arg(short, long, value_parser = ["true", "false"], value_name = "BOOL")]
#[arg(short, long, value_name = "BOOL")]
pub inherit_style: Option<bool>,

/// number of pipes
Expand Down
6 changes: 3 additions & 3 deletions crates/rng/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
edition = "2021"
license = "MIT OR Apache-2.0"
license = "BlueOak-1.0.0"
name = "rng"
version = "0.0.0"

[dependencies]
once_cell = "1.13.0"
oorandom = "11.1"
once_cell = "1.17.1"
oorandom = "11.1.3"
parking_lot = "0.12.1"
10 changes: 5 additions & 5 deletions crates/terminal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
edition = "2021"
license = "MIT OR Apache-2.0"
license = "BlueOak-1.0.0"
name = "terminal"
version = "0.0.0"

[dependencies]
anyhow = "1.0"
crossterm = "0.24.0"
unicode-width = "0.1.8"
anyhow = "1.0.70"
crossterm = "0.26.1"
unicode-width = "0.1.10"

[dependencies.flume]
default_features = false
version = "0.10.2"
version = "0.10.14"
Loading

0 comments on commit 52432d0

Please sign in to comment.