From 1f002cb7cae8d3e0d78070d8ca23f7cce72e6754 Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sun, 10 Aug 2025 22:06:46 -0300 Subject: [PATCH] Keep adding docs --- src/cli.rs | 7 +++++++ src/state.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index da31351..4d30a2a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -38,12 +38,14 @@ //! let args = Args::parse(); //! ``` +/// Payphone's argument parser. #[derive(clap::Parser)] pub struct Args { /// The Discord bot token to run the bot with. #[arg(env = "PAYPHONE_TOKEN")] pub token: String, + /// The minimum level logs have to be to be outputted into the console, or off for no logs. #[arg( long, short, @@ -55,6 +57,7 @@ pub struct Args { )] pub logging: LevelFilter, + /// The socket address of the database to connect to, a Scylla node. #[arg( long, short, @@ -65,6 +68,10 @@ pub struct Args { pub database_addr: String, } +/// An enum with the different logging levels that can be used in the CLI. +/// +/// This enum is used to parse the `--logging` or `-l` command line argument and then map the value +/// to [`log::LevelFilter`]. #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)] pub enum LevelFilter { Off, diff --git a/src/state.rs b/src/state.rs index 4f621ef..fd3f923 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,4 +1,4 @@ -//! Application state at runtime, including the database connection and other shared resources. +//! Application state at runtime including shared resources. //! //! Currently, it only contains the database connection, but it can be extended in the future to //! include other resources that need to be shared across the application, such as caches or