Skip to content

Commit

Permalink
support for ANSI colors and replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
ttschnz committed Jun 15, 2022
1 parent 57040a5 commit 3fc19e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ tokio = { version = "1", features = ["full"] }
serde = { version = "1.0.104", features = ["derive"] }
serde_json = "1.0.48"
colored = "2.0.0"
termsize = "0.1"
termsize = "0.1"
ansi_term = "0.12.1"
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ use serde_json::Value;
use colored::Colorize;
use std::io;
use std::io::Write;

use ansi_term;
// This is using the `tokio` runtime. You'll need the following dependency:
//
// `tokio = { version = "1", features = ["full"] }`
#[cfg(not(target_arch = "wasm32"))]
#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
use std::{time::Duration};
ansi_term::enable_ansi_support().expect("Failed to enable ANSI support");

let mut cookies = String::new();
println!("Head over to (https://win.migros.ch/promos/) and paste the cookie data from your browser: ");
Expand Down

0 comments on commit 3fc19e3

Please sign in to comment.