Added some fixes for the Linux installer/service - now shipping a log4rs config; creates /var/log for log files; fixed name of service file
This commit is contained in:
11
src/main.rs
11
src/main.rs
@ -12,6 +12,10 @@ mod util;
|
||||
#[derive(Parser)]
|
||||
#[clap(author, version, about, long_about = None)]
|
||||
struct Cli {
|
||||
/// Number of times to greet
|
||||
#[clap(short = 'l', long, default_value_t = String::from("./log4rs.yaml"))]
|
||||
log_config: String,
|
||||
|
||||
#[clap(subcommand)]
|
||||
command: Option<Commands>,
|
||||
}
|
||||
@ -23,12 +27,13 @@ enum Commands {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// initialize the log4rs logger
|
||||
log4rs::init_file("./log4rs.yaml", Default::default()).unwrap();
|
||||
|
||||
// initialize the clap CLI
|
||||
let cli = Cli::parse();
|
||||
|
||||
// grab the log4rs config file path, then initialize log4rs
|
||||
let log4rs_config: String = cli.log_config;
|
||||
log4rs::init_file(&log4rs_config, Default::default()).unwrap();
|
||||
|
||||
match &cli.command {
|
||||
// sub-commands will be handled here
|
||||
Some(Commands::Setup {}) => cmd::core::setup_command(),
|
||||
|
Reference in New Issue
Block a user