Skip to content

Commit

Permalink
chore(ascii): Dynamically retrieve version from Cargo.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnwriter committed Sep 25, 2023
1 parent cc3c4f6 commit dd4d8cd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ clap = { version = "4.4.4", features = ["derive", "string"] }
columns = "0.1.0"
colored = "2.0.4"

[[bin]]
name = "hxn"
path = "src/main.rs"


[profile.dev]
opt-level = 0
debug = true
Expand Down
4 changes: 2 additions & 2 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use clap::Parser;
#[command(propagate_version = true)]
#[command(arg_required_else_help = true)]
pub struct Cli {
#[arg(required = false,short, long)]
/// Website URL/filename of file containing URLs
#[arg(required = false, short, long)]
/// a single url or a file containing multiple urls
pub url: Option<String>,

#[arg(short, long, default_value = "hxnshots")]
Expand Down
15 changes: 11 additions & 4 deletions src/cli/ascii.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
use colored::Colorize;

pub const BAR: &str = r"
────────────────────────────────
";

pub const RESET: &str = "\x1B[0m"; //( resets the text color to the default)
pub const RESET: &str = "\x1B[0m"; // (resets the text color to the default)

pub fn splash() -> String {
let logo = r"
let hxn_version = env!("CARGO_PKG_VERSION");

let logo = format!(
r#"
╦ ╦╔═╗╦ ╦╦ ╔═╗╔╗╔
╠═╣╠═╣╚╦╝║ 𝖃║ ║║║║
╩ ╩╩ ╩ ╩ ╩═╝ ╚═╝╝╚╝v0.1.6
╩ ╩╩ ╩ ╩ ╩═╝ ╚═╝╝╚╝v{}
by @PwnWriter
"
"#,
hxn_version
)
.purple();

let quote = " Shoot before the blink  ".italic();

format!("{logo} {quote}")
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::cli::{args, screenshot::run};
use clap::Parser;
use {
crate::cli::{args, screenshot::run},
clap::Parser,
};

mod cli;
mod log;
Expand Down

0 comments on commit dd4d8cd

Please sign in to comment.