cli.rs

Overview

This file defines the command-line interface (CLI) for the Acki Nacki proxy publisher application. It uses the clap crate to parse command-line arguments and provides metadata about the build version and environment through a lazily initialized static string. The primary purpose of this file is to expose user-configurable parameters for the proxy publisher, specifically the endpoint URL to which the proxy connects or publishes.

Detailed Explanation

Static Variable: LONG_VERSION

pub static LONG_VERSION: LazyLock<String>

Struct: CliArgs

#[derive(Parser, Debug)]
#[command(author, long_version = &**LONG_VERSION, about, long_about = None)]
pub struct CliArgs {
    #[arg(short, long, default_value = "localhost:8090")]
    pub endpoint: Url,
}
acki-nacki-proxy-publisher --endpoint http://example.com:9000

This command runs the proxy publisher with the endpoint set to http://example.com:9000.

Implementation Details

Interaction with Other Parts of the System

Mermaid Diagram

classDiagram
class CliArgs {
+endpoint: Url
}
class LONG_VERSION {
<<static>>
+String value
}
CliArgs ..> Url : uses
LONG_VERSION ..> String : contains

The diagram shows the main data structure CliArgs with its endpoint property of type Url. The LONG_VERSION static holds a detailed version string. The arrows indicate usage or containment relationships.