Break up code into multiple files

In order to increase readability, maintainability and maybe a future
independence regarding web frameworks move code to new files.
This commit is contained in:
finga 2021-11-11 21:09:47 +01:00
parent b2205ea5f4
commit d92e8029f2
3 changed files with 191 additions and 175 deletions

22
src/cli.rs Normal file
View file

@ -0,0 +1,22 @@
use clap::{crate_authors, crate_version, AppSettings, Parser};
#[derive(Debug, Parser)]
pub enum Command {
/// Verifies if the configuration can be parsed without errors
Configtest,
}
#[derive(Debug, Parser)]
#[clap(
version = crate_version!(),
author = crate_authors!(", "),
global_setting = AppSettings::InferSubcommands,
global_setting = AppSettings::PropagateVersion,
)]
pub struct Opts {
/// Provide a path to the configuration file
#[clap(short, long, value_name = "FILE")]
pub config: Option<String>,
#[clap(subcommand)]
pub command: Option<Command>,
}