From e258bcc2bd1bda7e39e2f7cda3b12d5627556471 Mon Sep 17 00:00:00 2001 From: Daniel Szabo Date: Tue, 25 Oct 2022 12:51:59 +0300 Subject: [PATCH] added missing bracket in args.rs --- src/args.rs | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/args.rs b/src/args.rs index e4029d4..b570cb8 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,9 +1,9 @@ +use clap::Parser; +use lazy_static::lazy_static; use std::convert::Infallible; use std::fmt; use std::net::IpAddr; use std::str::FromStr; -use clap::Parser; -use lazy_static::lazy_static; lazy_static! { pub static ref ARGS: Args = Args::parse(); @@ -12,61 +12,61 @@ lazy_static! { #[derive(Parser, Debug, Clone)] #[clap(author, version, about, long_about = None)] pub struct Args { - #[clap(long, env="MICROBIN_AUTH_USERNAME")] + #[clap(long, env = "MICROBIN_AUTH_USERNAME")] pub auth_username: Option, - #[clap(long, env="MICROBIN_AUTH_PASSWORD")] + #[clap(long, env = "MICROBIN_AUTH_PASSWORD")] pub auth_password: Option, - #[clap(long, env="MICROBIN_EDITABLE")] + #[clap(long, env = "MICROBIN_EDITABLE")] pub editable: bool, - #[clap(long, env="MICROBIN_FOOTER_TEXT")] + #[clap(long, env = "MICROBIN_FOOTER_TEXT")] pub footer_text: Option, - #[clap(long, env="MICROBIN_HIDE_FOOTER")] + #[clap(long, env = "MICROBIN_HIDE_FOOTER")] pub hide_footer: bool, - #[clap(long, env="MICROBIN_HIDE_HEADER")] + #[clap(long, env = "MICROBIN_HIDE_HEADER")] pub hide_header: bool, - #[clap(long, env="MICROBIN_HIDE_LOGO")] + #[clap(long, env = "MICROBIN_HIDE_LOGO")] pub hide_logo: bool, - #[clap(long, env="MICROBIN_NO_LISTING")] + #[clap(long, env = "MICROBIN_NO_LISTING")] pub no_listing: bool, - #[clap(long, env="MICROBIN_HIGHLIGHTSYNTAX")] + #[clap(long, env = "MICROBIN_HIGHLIGHTSYNTAX")] pub highlightsyntax: bool, - #[clap(short, long, env="MICROBIN_PORT", default_value_t = 8080)] + #[clap(short, long, env = "MICROBIN_PORT", default_value_t = 8080)] pub port: u16, #[clap(short, long, env="MICROBIN_BIND", default_value_t = IpAddr::from([0, 0, 0, 0]))] pub bind: IpAddr, - #[clap(long, env="MICROBIN_PRIVATE")] + #[clap(long, env = "MICROBIN_PRIVATE")] pub private: bool, - #[clap(long, env="MICROBIN_PURE_HTML")] + #[clap(long, env = "MICROBIN_PURE_HTML")] pub pure_html: bool, #[clap(long, env="MICROBIN_PUBLIC_PATH", default_value_t = PublicUrl(String::from("")))] pub public_path: PublicUrl, - #[clap(long, env="MICROBIN_READONLY")] + #[clap(long, env = "MICROBIN_READONLY")] pub readonly: bool, - #[clap(long, env="MICROBIN_TITLE")] + #[clap(long, env = "MICROBIN_TITLE")] pub title: Option, - #[clap(short, long, env="MICROBIN_THREADS", default_value_t = 1)] + #[clap(short, long, env = "MICROBIN_THREADS", default_value_t = 1)] pub threads: u8, - #[clap(long, env="MICROBIN_WIDE")] + #[clap(long, env = "MICROBIN_WIDE")] pub wide: bool, - - #[clap(short, long, env="MICROBIN_NO_FILE_UPLOAD")] + + #[clap(short, long, env = "MICROBIN_NO_FILE_UPLOAD")] pub no_file_upload: bool, } @@ -86,3 +86,4 @@ impl FromStr for PublicUrl { let uri = s.strip_suffix('/').unwrap_or(s).to_owned(); Ok(PublicUrl(uri)) } +}