mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
move 'serve' command logic into a submodule of 'cli'
The changes to 'main.rs' and 'cli/serve.rs' in this commit are almost pure code-motion.
This commit is contained in:
parent
be87774a3b
commit
86515d53cc
3 changed files with 677 additions and 659 deletions
15
src/cli.rs
15
src/cli.rs
|
|
@ -1,9 +1,16 @@
|
|||
//! Integration with `clap`
|
||||
//!
|
||||
//! CLI argument structs are defined in this module. Execution logic for each
|
||||
//! command goes in a submodule.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
use crate::error;
|
||||
|
||||
mod serve;
|
||||
|
||||
/// Command line arguments
|
||||
#[derive(Parser)]
|
||||
#[clap(
|
||||
|
|
@ -49,3 +56,11 @@ pub(crate) struct ServeArgs {
|
|||
#[clap(flatten)]
|
||||
pub(crate) config: ConfigArg,
|
||||
}
|
||||
|
||||
impl Args {
|
||||
pub(crate) async fn run(self) -> Result<(), error::Main> {
|
||||
match self.command {
|
||||
Command::Serve(args) => serve::run(args).await,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue