feat: add subcommands cli, serve
This commit is contained in:
@@ -2,6 +2,9 @@ use clap::{App, AppSettings, ArgMatches};
|
||||
use rust_util::{failure_and_exit, information};
|
||||
use rust_util::util_clap::{Command, CommandError};
|
||||
|
||||
mod cli;
|
||||
mod serve;
|
||||
|
||||
pub struct DefaultCommandImpl;
|
||||
|
||||
impl DefaultCommandImpl {
|
||||
@@ -21,7 +24,10 @@ fn main() {
|
||||
}
|
||||
|
||||
fn inner_main() -> CommandError {
|
||||
let commands: Vec<Box<dyn Command>> = vec![];
|
||||
let commands: Vec<Box<dyn Command>> = vec![
|
||||
Box::new(cli::CommandImpl),
|
||||
Box::new(serve::CommandImpl),
|
||||
];
|
||||
let mut app = App::new(env!("CARGO_PKG_NAME"))
|
||||
.version(env!("CARGO_PKG_VERSION"))
|
||||
.about(env!("CARGO_PKG_DESCRIPTION"))
|
||||
|
||||
Reference in New Issue
Block a user