Skip to content

Commit

Permalink
make 'color' an optional feature for building the legacy binary
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptaliagy committed Jul 9, 2024
1 parent 232ed2e commit b4c4f5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ test = false
name = "tomlq"
path = "src/legacy.rs"
test = false
required-features = ["color"]

[package.metadata.binstall]
pkg-fmt = "tgz"
Expand Down
20 changes: 12 additions & 8 deletions src/legacy.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
use clap::Parser;
#[cfg(feature = "color")]
use colored::Colorize;
use std::process::exit;
use tq::OutputType;

fn main() {
eprintln!(
"{}",
"You are currently using the legacy version of tomlq. Please use the new binary \"tq\" instead.".yellow()
);
eprintln!(
"{}",
"The \"tomlq\" binary will be removed from this package starting in version 0.2.0, scheduled for January 1, 2025".yellow()
);
let warning = "You are currently using the legacy version of tomlq. Please use the new binary \"tq\" instead.";
let deprecation = "The \"tomlq\" binary will be removed from this package starting in version 0.2.0, scheduled for January 1, 2025";

#[cfg(feature = "color")]
let warning = warning.yellow();

#[cfg(feature = "color")]
let deprecation = deprecation.yellow();

eprintln!("{}", warning,);
eprintln!("{}", deprecation);

let app = tq::Cli::parse();

Expand Down

0 comments on commit b4c4f5b

Please sign in to comment.