diff --git a/Cargo.lock b/Cargo.lock index 62e0c06..d6f6ba9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -232,6 +232,27 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +[[package]] +name = "color-print" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa954171903797d5623e047d9ab69d91b493657917bdfb8c2c80ecaf9cdb6f4" +dependencies = [ + "color-print-proc-macro", +] + +[[package]] +name = "color-print-proc-macro" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692186b5ebe54007e45a59aea47ece9eb4108e141326c304cdc91699a7118a22" +dependencies = [ + "nom", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "colorchoice" version = "1.0.3" @@ -1024,6 +1045,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.8.8" @@ -1061,6 +1088,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -1995,6 +2032,7 @@ version = "0.4.1" dependencies = [ "anyhow", "clap", + "color-print", "dirs", "flate2", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index a097668..43c4f9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ futures-util = "0.3" flate2 = "1.0" tar = "0.4" xz2 = "0.1.7" +color-print = "0.3.7" # The profile that 'cargo dist' will build with [profile.dist] diff --git a/src/main.rs b/src/main.rs index 30f05a7..d509aac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,8 +7,17 @@ mod cmds; mod perm_path; mod tools; +pub const BANNER: &str = color_print::cstr! { + r#" +<#FFFFFF>████████╗<#999999>██╗ ██╗<#FF007F>██████╗ +<#FFFFFF>╚══██╔══╝<#999999>╚██╗██╔╝<#FF007F>╚════██╗ +<#FFFFFF> ██║ <#999999> ╚███╔╝ <#FF007F> █████╔╝ +<#FFFFFF> ██║ <#999999> ██╔██╗ <#FF007F> ╚═══██╗ +<#FFFFFF> ██║ <#999999>██╔╝ ██╗<#FF007F>██████╔╝ +<#FFFFFF> ╚═╝ <#999999>╚═╝ ╚═╝<#FF007F>╚═════╝ "# + }; #[derive(Parser)] -#[command(author, version, about, long_about = None)] +#[command(author, version, about, long_about = Some(BANNER))] struct Cli { #[arg(short, long, env = "TX3_ROOT")] root_dir: Option, @@ -81,6 +90,8 @@ async fn main() -> Result<()> { channel: cli.channel, }; + println!("\n {}\n", BANNER.trim_start()); + if let Some(command) = cli.command { match command { Commands::Install(args) => cmds::install::run(&args, &config).await?,