mod start;
mod version;
use self::{start::StartCmd, version::VersionCmd};
use crate::config::DelphiConfig;
use abscissa_core::{Command, Configurable, Help, Options, Runnable};
use std::path::PathBuf;
pub const CONFIG_FILE: &str = "delphi.toml";
#[derive(Command, Debug, Options, Runnable)]
pub enum DelphiCmd {
#[options(help = "get usage information")]
Help(Help<Self>),
#[options(help = "start the application")]
Start(StartCmd),
#[options(help = "display version information")]
Version(VersionCmd),
}
impl Configurable<DelphiConfig> for DelphiCmd {
fn config_path(&self) -> Option<PathBuf> {
let filename = PathBuf::from(CONFIG_FILE);
if filename.exists() {
Some(filename)
} else {
None
}
}
}