mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-11-16 15:40:50 +01:00
Add argument parser for the conduit executable
Allow fetching the version with `conduit --version`. Fixes #285.
This commit is contained in:
parent
88fbd5b294
commit
9a81a49c6a
3 changed files with 16 additions and 0 deletions
13
src/clap.rs
Normal file
13
src/clap.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
//! Integration with `clap`
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
/// Command line arguments
|
||||
#[derive(Parser)]
|
||||
#[clap(about, version)]
|
||||
pub struct Args {}
|
||||
|
||||
/// Parse command line arguments into structured data
|
||||
pub fn parse() -> Args {
|
||||
Args::parse()
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
pub mod api;
|
||||
pub mod clap;
|
||||
mod config;
|
||||
mod database;
|
||||
mod service;
|
||||
|
|
|
@ -44,6 +44,8 @@ static GLOBAL: Jemalloc = Jemalloc;
|
|||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
clap::parse();
|
||||
|
||||
// Initialize config
|
||||
let raw_config =
|
||||
Figment::new()
|
||||
|
|
Loading…
Reference in a new issue