1
0
Fork 0
mirror of https://gitlab.com/news-flash/article_scraper.git synced 2025-07-08 16:40:00 +02:00

first few cli args

This commit is contained in:
Jan Lukas Gernert 2023-04-05 08:43:00 +02:00
parent 4a7349a5fa
commit a2719c8c7e
3 changed files with 39 additions and 2 deletions

View file

@ -0,0 +1,31 @@
use clap::{command, Parser, Subcommand};
use std::path::PathBuf;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
pub struct Args {
/// Turn debug logging on
#[arg(short, long)]
debug: bool,
#[command(subcommand)]
command: Option<Commands>,
/// Destination of resulting HTML file
#[arg(short, long, value_name = "FILE")]
output: Option<PathBuf>,
}
#[derive(Subcommand)]
enum Commands {
/// Only use the Readability parser
Readability {
/// Source HTML file
#[arg(long, value_name = "FILE")]
html: Option<PathBuf>,
/// Source Url
#[arg(long, value_name = "URL")]
source_url: Option<String>,
},
}