Linted code.
This commit is contained in:
1 parent
894f969d0f
commit
174d7e855a
17 files changed
+304
-206
No files matched your search
+22
-18
@@ -1,7 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Arg, ArgAction, ArgMatches, Command, value_parser};
|
||||
use clap::parser::ValuesRef;
|
||||
use clap::{value_parser, Arg, ArgAction, ArgMatches, Command};
|
||||
use log::{debug, error, info};
|
||||
use rusqlite::Connection;
|
||||
use serde::Serialize;
|
||||
@@ -99,18 +99,14 @@ fn new_user_command_line_parser() -> Command {
|
||||
}
|
||||
|
||||
fn ls_user_command_line_parser() -> Command {
|
||||
return Command::new("ls")
|
||||
.long_flag("ls")
|
||||
.about("List all users.");
|
||||
return Command::new("ls").long_flag("ls").about("List all users.");
|
||||
}
|
||||
|
||||
|
||||
fn process_events_command_line_parser() -> Command {
|
||||
Command::new("process")
|
||||
.about("Process events one after the other. In the order received")
|
||||
.arg_required_else_help(true)
|
||||
.arg(clap::arg!(<PATH> ... "Stuff to add")
|
||||
.value_parser(value_parser!(PathBuf)))
|
||||
.arg(clap::arg!(<PATH> ... "Stuff to add").value_parser(value_parser!(PathBuf)))
|
||||
}
|
||||
|
||||
fn user_command_line_parser() -> Command {
|
||||
@@ -136,16 +132,19 @@ fn ls_securities_command_line_parser() -> Command {
|
||||
|
||||
fn run_web_ui_command_line_parser() -> Command {
|
||||
return Command::new("run")
|
||||
.arg(Arg::new("port")
|
||||
.long("port")
|
||||
.value_parser(clap::value_parser!(u16).range(3000..))
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3200"))
|
||||
.arg(Arg::new("enable-template-autoreload")
|
||||
.long("enable-template-autoreload")
|
||||
.required(false)
|
||||
.num_args(0)
|
||||
.help("Reload underlying template (for development)")
|
||||
.arg(
|
||||
Arg::new("port")
|
||||
.long("port")
|
||||
.value_parser(clap::value_parser!(u16).range(3000..))
|
||||
.action(ArgAction::Set)
|
||||
.default_value("3200"),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("enable-template-autoreload")
|
||||
.long("enable-template-autoreload")
|
||||
.required(false)
|
||||
.num_args(0)
|
||||
.help("Reload underlying template (for development)"),
|
||||
)
|
||||
.about("Run web user interface.");
|
||||
}
|
||||
@@ -356,7 +355,12 @@ mod cli_test {
|
||||
self.process_events_count += 1;
|
||||
}
|
||||
|
||||
fn run_webui(&mut self, conn: &mut Connection, port: u16, enable_template_autoreload: bool) {
|
||||
fn run_webui(
|
||||
&mut self,
|
||||
conn: &mut Connection,
|
||||
port: u16,
|
||||
enable_template_autoreload: bool,
|
||||
) {
|
||||
self.run_webui_count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user