options to env handling
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/05/29 21:22:17 by tomoron #+# #+# */
|
||||
/* Updated: 2026/06/04 12:37:14 by tomoron ### ########.fr */
|
||||
/* Updated: 2026/06/05 00:11:54 by tomoron ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -74,13 +74,13 @@ fn cli() -> Command {
|
||||
}
|
||||
|
||||
#[tokio::main(flavor = "current_thread")]
|
||||
async fn main() -> io::Result<()> {
|
||||
async fn main() -> Result<(), String> {
|
||||
let arg = cli().get_matches();
|
||||
let pool = get_connection_pool();
|
||||
|
||||
match arg.subcommand() {
|
||||
Some(("serverMode", _)) => { mc_socket_listen(pool).await?; },
|
||||
Some(("add", sub_matches)) => { add::subcommand(sub_matches); },
|
||||
Some(("serverMode", _)) => { mc_socket_listen(pool).await.map_err(|_| "socket error".to_string())?; },
|
||||
Some(("add", sub_matches)) => { add::subcommand(sub_matches)?; },
|
||||
_ => {panic!("subcommand not implemented")}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user