Downgraded version of Clap module; started work on a configure subcommand to help users set up their service
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -4,24 +4,31 @@ use config::Config;
|
||||
use transcoder::repository::Repository;
|
||||
use transcoder::transcoder::Transcoder;
|
||||
|
||||
mod cmd;
|
||||
mod settings;
|
||||
mod transcoder;
|
||||
mod util;
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(author, version, about, long_about = None)]
|
||||
#[clap(author, version, about, long_about = None)]
|
||||
struct Cli {
|
||||
#[command(subcommand)]
|
||||
#[clap(subcommand)]
|
||||
command: Option<Commands>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
/// displays version info about this program
|
||||
ToDo {},
|
||||
Configure {},
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// set the configuration file path depending on the OS
|
||||
let mut config_path: &str = "/etc/zealot/config.toml";
|
||||
if cfg!(windows) {
|
||||
config_path = "C:\\Program Files\\Zealot\\config.toml";
|
||||
}
|
||||
|
||||
// initialize the log4rs logger
|
||||
log4rs::init_file("./log4rs.yaml", Default::default()).unwrap();
|
||||
|
||||
@@ -30,7 +37,7 @@ fn main() {
|
||||
|
||||
match &cli.command {
|
||||
// sub-commands will be handled here
|
||||
Some(_) => todo!(),
|
||||
Some(Commands::Configure {}) => cmd::core::configure_command(config_path),
|
||||
|
||||
// run the main program without any commands
|
||||
None => {
|
||||
|
Reference in New Issue
Block a user