use std::path::PathBuf;
use structopt::clap::AppSettings;
use structopt::clap::Shell;
use structopt::StructOpt;
use crate::configuration::ConfigCommand;
use crate::the_way::filter::Filters;
#[derive(Debug, StructOpt)]
#[structopt(
name = "the-way",
rename_all = "kebab-case",
global_settings = & [AppSettings::DeriveDisplayOrder]
)]
pub enum TheWayCLI {
New,
Search {
#[structopt(flatten)]
filters: Filters,
},
Sync,
Edit {
index: usize,
},
#[structopt(alias = "delete")]
Del {
index: usize,
#[structopt(long, short)]
force: bool,
},
#[structopt(alias = "copy")]
Cp {
index: usize,
},
View {
index: usize,
},
List {
#[structopt(flatten)]
filters: Filters,
},
Import {
#[structopt(parse(from_os_str))]
file: Option<PathBuf>,
},
Export {
#[structopt(parse(from_os_str))]
file: Option<PathBuf>,
#[structopt(flatten)]
filters: Filters,
},
Clear {
#[structopt(long, short)]
force: bool,
},
Complete {
#[structopt(possible_values = & Shell::variants())]
shell: Shell,
},
Themes {
#[structopt(subcommand)]
cmd: ThemeCommand,
},
#[structopt(alias = "configure")]
Config {
#[structopt(subcommand)]
cmd: ConfigCommand,
},
}
#[derive(StructOpt, Debug)]
pub enum ThemeCommand {
List,
Set { theme: String },
Add {
#[structopt(parse(from_os_str))]
file: PathBuf,
},
Language {
#[structopt(parse(from_os_str))]
file: PathBuf,
},
Get,
}