Keep adding docs
This commit is contained in:
@@ -38,12 +38,14 @@
|
|||||||
//! let args = Args::parse();
|
//! let args = Args::parse();
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
|
/// Payphone's argument parser.
|
||||||
#[derive(clap::Parser)]
|
#[derive(clap::Parser)]
|
||||||
pub struct Args {
|
pub struct Args {
|
||||||
/// The Discord bot token to run the bot with.
|
/// The Discord bot token to run the bot with.
|
||||||
#[arg(env = "PAYPHONE_TOKEN")]
|
#[arg(env = "PAYPHONE_TOKEN")]
|
||||||
pub token: String,
|
pub token: String,
|
||||||
|
|
||||||
|
/// The minimum level logs have to be to be outputted into the console, or off for no logs.
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
short,
|
short,
|
||||||
@@ -55,6 +57,7 @@ pub struct Args {
|
|||||||
)]
|
)]
|
||||||
pub logging: LevelFilter,
|
pub logging: LevelFilter,
|
||||||
|
|
||||||
|
/// The socket address of the database to connect to, a Scylla node.
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
short,
|
short,
|
||||||
@@ -65,6 +68,10 @@ pub struct Args {
|
|||||||
pub database_addr: String,
|
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)]
|
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, clap::ValueEnum)]
|
||||||
pub enum LevelFilter {
|
pub enum LevelFilter {
|
||||||
Off,
|
Off,
|
||||||
|
|||||||
+1
-1
@@ -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
|
//! 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
|
//! include other resources that need to be shared across the application, such as caches or
|
||||||
|
|||||||
Reference in New Issue
Block a user