use argh::FromArgs; use std::path::PathBuf; #[derive(FromArgs)] #[argh(description = "Tool for gathering location data from Yepzon servers.")] pub struct EnvOpt { #[argh(subcommand)] pub subcommand: Subcommand, } #[derive(FromArgs)] #[argh(subcommand)] pub enum Subcommand { Since(SinceOpt), Init(InitOpt), } #[derive(FromArgs)] #[argh( subcommand, name = "since", description = "fetch locations for a given section in time.\nsince and until in format dd.mm.yyy, OR hh:mm:ss, OR dd.mm.yyy-hh:mm:ss" )] pub struct SinceOpt { #[argh( option, short = 'c', description = "config.toml file path.", default = "PathBuf::from(\"config.toml\")" )] pub config: PathBuf, #[argh( positional, short = 's', description = "the oldest point in time to get locations from." )] pub since: String, #[argh( option, short = 'u', description = "the most recent point in time to get locations from, default = now." )] pub until: Option, } #[derive(FromArgs)] #[argh(subcommand, name = "init", description = "initializes a config file")] pub struct InitOpt {}