use argh::FromArgs;
use std::error::Error;

/// Manage backups
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "backup")]
pub struct Args {
    /// backup operation
    #[argh(subcommand)]
    subcommand: SubCommand,
}

#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
enum SubCommand {
    Create(CreateArgs),
    Restore(RestoreArgs),
    List(ListArgs),
}

/// Create a new backup file
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "create")]
pub struct CreateArgs {}

/// Restore from a backup
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "restore")]
pub struct RestoreArgs {
    /// path to backup file
    #[argh(positional)]
    path: String,
}

/// List backups
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "list")]
pub struct ListArgs {}

/// FIXME
pub fn main(_: &Args) -> Result<(), Box<dyn Error>> {
    Ok(())
}
