Going somewhere.
This commit is contained in:
1 parent
4a86c4250a
commit
511b2a88f6
6 files changed
+127
-18
No files matched your search
+6
-5
@@ -7,7 +7,7 @@ use log::{debug, info};
|
||||
use rusqlite::Connection;
|
||||
use simple_logger::SimpleLogger;
|
||||
|
||||
use crate::migration::migrate;
|
||||
use crate::migration::apply_migrations;
|
||||
|
||||
mod migration;
|
||||
mod users;
|
||||
@@ -68,8 +68,8 @@ fn new_user_command_line_parser() -> Command {
|
||||
return Command::new("new")
|
||||
.long_flag("new")
|
||||
.about("Create new user.")
|
||||
.arg(Arg::new("name").long("name").help("name of new user.").action(ArgAction::Set))
|
||||
.arg(Arg::new("public_key").long("public-key").help("public key of users.").action(ArgAction::Set));
|
||||
.arg(Arg::new("name").long("name").required(true).help("name of new user.").action(ArgAction::Set))
|
||||
.arg(Arg::new("public_key").required(true).long("public-key").help("public key of users.").action(ArgAction::Set));
|
||||
}
|
||||
|
||||
fn ls_user_command_line_parser() -> Command {
|
||||
@@ -308,14 +308,15 @@ fn set_logger(m: &ArgMatches) {
|
||||
SimpleLogger::new().with_level(get_verbosity(&m)).init().unwrap();
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
let command = command_line_parser();
|
||||
let m = command.get_matches();
|
||||
|
||||
set_logger(&m);
|
||||
let mut conn = get_connection(&m);
|
||||
let migrations: Vec<String> = Vec::new();
|
||||
migrate(&mut conn, & migrations).unwrap();
|
||||
|
||||
apply_migrations(&mut conn).unwrap();
|
||||
let mut logic = ProCommandLineLogic::new();
|
||||
process_command_line(&conn, &m, &mut logic);
|
||||
}
|
||||
Reference in new issue
Block a user