Add initial CLI model

This commit is contained in:
Martin Wurm 2023-07-20 06:02:19 +02:00
parent 6b792c16dd
commit c167b9c053
2 changed files with 60 additions and 2 deletions

View file

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
clap = { features = ["derive"] }

View file

@ -1,3 +1,60 @@
fn main() { use std::path::PathBuf;
println!("Hello, world!");
use clap::Parser;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct Args {
/*
See https://wiki.xmltv.org/index.php/XmltvCapabilities for a full
description of CLI parameters needed to comply with the XMLTV standard.
Targeted capabilities:
- baseline
- manualconfig
- cache
*/
/// Print a description that identifies this grabber
#[arg(long = "description")]
print_description: bool, // TODO
/// Print a list of this grabber's capabilities.
/// See https://wiki.xmltv.org/index.php/XmltvCapabilities for more
/// information
#[arg(long = "capabilities")]
print_capabilities: bool, // TODO
/// Bring up interactive configuration dialogue
#[arg(long = "configure")]
perform_configuration: bool, // TODO
/// Suppress all progress information
#[arg(short = 'q', long = "quiet")]
be_quiet: bool, // TODO
/// Redirect output to the specified file instead of printing to stdout
#[arg(short, long = "output", value_name = "FILE")]
output_file: Option<PathBuf>, // TODO
/// The number of days to fetch programme data for
#[arg(short, long)]
days: Option<i32>, // TODO
/// Start fetching programme data starting $DAYS days in the future
#[arg(short = 'O', long, value_name = "N")]
offset: Option<i32>, // TODO
/// Read and write all configuration to and from this file
#[arg(short = 'c', long = "config-file", value_name = "FILE")]
config_file: Option<PathBuf>, // TODO
/// Cache fetched data in the specified file
#[arg(short = 'C', long = "cache", value_name = "FILE")]
cache_file: Option<PathBuf>, // TODO
}
fn main() {
let args = Args::parse();
println!("Inputs: {:#?}", args);
} }