ssservice genkey, helper for generate encryption key

This commit is contained in:
zonyitoo
2022-10-17 22:29:02 +08:00
parent 0d6bfa32d5
commit 45cc770ef4
5 changed files with 55 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
use std::{env, path::Path, process::ExitCode};
use clap::Command;
use shadowsocks_rust::service::{local, manager, server};
use shadowsocks_rust::service::{genkey, local, manager, server};
fn main() -> ExitCode {
let app = Command::new("shadowsocks")
@@ -36,12 +36,17 @@ fn main() -> ExitCode {
.subcommand(
manager::define_command_line_options(Command::new("manager")).about("Shadowsocks Server Manager service"),
)
.subcommand(
genkey::define_command_line_options(Command::new("genkey"))
.about("Generate shadowsocks encryption key for method"),
)
.get_matches();
match matches.subcommand() {
Some(("local", matches)) => local::main(matches),
Some(("server", matches)) => server::main(matches),
Some(("manager", matches)) => manager::main(matches),
Some(("genkey", matches)) => genkey::main(matches),
_ => unreachable!("expecting a subcommand"),
}
}