use std::path::PathBuf;
use clap::{Parser, Subcommand};
pub const INFO: &str = r"
░ ░░░ ░░ ░░ ░░░░ ░░░ ░░░ ░░░ ░
▒ ▒▒▒▒ ▒▒ ▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒ ▒▒ ▒▒ ▒▒▒▒ ▒▒ ▒▒ ▒
▓ ▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓ ▓▓▓▓ ▓▓ ▓ ▓ ▓
█ ███ ███ ████████ ████████ █ █ ██ ██ ██ █
█ ████ ██ ██ ████████ ████ ██ ████ ██ ███ █
refman (v1.3.4)
------------------------------------------------------------
`refman` is a simple command-line tool for managing biological reference datasets often
used in bioinformatics. These datasets may include raw sequence files, files encoding
annotations on those sequences, etc. `refman` makes it easier to manage and download
these kinds of files globally on the user's machine, or on a per-project basis. It
uses a human-readable TOML file to track which files it's managing, which can be shared
between users to aid scientific reproducibility.
";
#[derive(Parser)]
#[clap(name = "refman")]
#[clap(about = INFO)]
#[clap(version = "v1.3.4")]
pub struct Cli {
#[command(flatten)]
pub verbose: clap_verbosity_flag::Verbosity,
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand)]
pub enum Commands {
#[clap(
about = "Initialize a registry for the current project without registering any datasets.",
visible_aliases = &["i", "new", "n"],
)]
Init {
#[arg(short, long, required = false)]
title: Option<String>,
#[arg(short, long, required = false)]
description: Option<String>,
#[arg(short, long, required = false)]
registry: Option<String>,
#[arg(short, long, required = false)]
global: bool,
},
#[clap(
about = "Register a new file or set of files with a given dataset label.",
visible_aliases = &["r", "reg"],
)]
Register {
#[arg(index = 1, required = true)]
label: String,
#[arg(long, required = false)]
fasta: Option<String>,
#[arg(long, required = false)]
genbank: Option<String>,
#[arg(long, required = false)]
gfa: Option<String>,
#[arg(long, required = false)]
gtf: Option<String>,
#[arg(long, required = false)]
gff: Option<String>,
#[arg(long, required = false)]
bed: Option<String>,
#[arg(long, required = false)]
tar: Option<String>,
#[arg(short, long, required = false)]
registry: Option<String>,
#[arg(short, long, required = false)]
global: bool,
},
#[clap(
about = "Remove the files associated with a given dataset label",
visible_aliases = &["rm", "del", "delete"],
)]
Remove {
#[arg(index = 1, required = true)]
label: String,
#[arg(short, long, required = false)]
registry: Option<String>,
#[arg(short, long, required = false)]
global: bool,
},
#[clap(
about = "List all previously registered reference datasets",
visible_aliases = &["l", "datasets"],
)]
List {
#[arg(index = 1, required = false)]
label: Option<String>,
#[arg(short, long, required = false)]
registry: Option<String>,
#[arg(short, long, required = false)]
global: bool,
},
#[clap(
about = "Download one or many reference datasets registered in the refman registry.",
visible_aliases = &["d", "dl", "down", "get", "g", "f", "fetch", "pull", "p"]
)]
Download {
#[arg(index = 1, required = false)]
label: Option<String>,
#[arg(short, long, required = false)]
dest: Option<PathBuf>,
#[arg(short, long, required = false)]
registry: Option<String>,
#[arg(short, long, required = false)]
global: bool,
#[arg(short, long, required = false)]
all: bool,
},
}