use clap::ValueHint;
use std::path::PathBuf;
static LONG_ABT: &str = r#"
crawn - A utility for web crawling and scraping
-> crawn provides a simple way for crawling URLs and scraping HTML from them.
-> crawn has exceptional speed due to being built in optimized Rust with tokio async.
-> Easy to debug errors with detailed logs.
╭──────────────────────·Examples·──────────────────────╮
│ ••• │
│ crawn https://ex.com/index.html > out.ndjson │
│ crawn https://ex.com/index.html -l f.log | jq -s '.' │
│ crawn https://ex.com/index.html -v | grep 'captcha' │
│ │
╰──────────────────────────────────────────────────────╯
"#;
#[derive(clap::Parser)]
#[command(
author,
version,
about = "A utility for web crawling and scraping",
long_about = LONG_ABT
)]
pub struct Args {
#[arg(value_hint = ValueHint::Url)]
pub url: Option<String>,
#[arg(short, long, value_hint = ValueHint::FilePath, global = true)]
pub log_file: Option<PathBuf>,
#[arg(long, global = true, conflicts_with = "include_text")]
pub include_content: bool,
#[arg(long, global = true, conflicts_with = "include_content")]
pub include_text: bool,
#[arg(short, long, global = true)]
pub max_depth: Option<u8>,
#[arg(short, long, global = true)]
pub verbose: bool,
}