diff options
| author | Kit La Touche <kit@transneptune.net> | 2024-11-11 14:45:39 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2024-11-11 14:45:39 -0500 |
| commit | 02c1866661de98b325b3266015d024b1e4f6c3b6 (patch) | |
| tree | 9def14624d0fab63cf4986f761326bb9fcda67d9 /src | |
| parent | e43cc0d606956c99ab109a63866f48a67aea6515 (diff) | |
| parent | a417c62edd4d3c07ba37b01835e89ed650489e09 (diff) | |
Merge branch 'main' into prop/message-delete
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.rs | 33 | ||||
| -rw-r--r-- | src/error.rs | 2 | ||||
| -rw-r--r-- | src/lib.rs | 2 | ||||
| -rw-r--r-- | src/main.rs | 2 |
4 files changed, 20 insertions, 19 deletions
@@ -1,6 +1,6 @@ -//! The `hi` command-line interface. +//! The `pilcrow` command-line interface. //! -//! This module supports running `hi` as a freestanding program, via the +//! This module supports running `pilcrow` as a freestanding program, via the //! [`Args`] struct. use std::{future, io}; @@ -22,18 +22,18 @@ use crate::{ ui, }; -/// Command-line entry point for running the `hi` server. +/// Command-line entry point for running the `pilcrow` server. /// /// This is intended to be used as a Clap [Parser], to capture command-line -/// arguments for the `hi` server: +/// arguments for the `pilcrow` server: /// /// ```no_run -/// # use hi::cli::Error; +/// # use pilcrow::cli::Error; /// # /// # #[tokio::main] /// # async fn main() -> Result<(), Error> { /// use clap::Parser; -/// use hi::cli::Args; +/// use pilcrow::cli::Args; /// /// let args = Args::parse(); /// args.run().await?; @@ -43,35 +43,36 @@ use crate::{ #[derive(Parser)] #[command( version, - about = "Run the `hi` server.", - long_about = r#"Run the `hi` server. + about = "Run the `pilcrow` server.", + long_about = r#"Run the `pilcrow` server. The database at `--database-url` will be created, or upgraded, automatically."# )] pub struct Args { - /// The network address `hi` should listen on + /// The network address `pilcrow` should listen on #[arg(short, long, env, default_value = "localhost")] address: String, - /// The network port `hi` should listen on + /// The network port `pilcrow` should listen on #[arg(short, long, env, default_value_t = 64209)] port: u16, - /// Sqlite URL or path for the `hi` database - #[arg(short, long, env, default_value = "sqlite://.hi")] + /// Sqlite URL or path for the `pilcrow` database + #[arg(short, long, env, default_value = "sqlite://pilcrow.db")] database_url: String, - /// Sqlite URL or path for a backup of the `hi` database during upgrades - #[arg(short = 'D', long, env, default_value = "sqlite://.hi.backup")] + /// Sqlite URL or path for a backup of the `pilcrow` database during + /// upgrades + #[arg(short = 'D', long, env, default_value = "sqlite://pilcrow.db.backup")] backup_database_url: String, } impl Args { - /// Runs the `hi` server, using the parsed configuation in `self`. + /// Runs the `pilcrow` server, using the parsed configuation in `self`. /// /// This will perform the following tasks: /// - /// * Migrate the `hi` database (at `--database-url`). + /// * Migrate the `pilcrow` database (at `--database-url`). /// * Start an HTTP server (on the interface and port controlled by /// `--address` and `--port`). /// * Print a status message. diff --git a/src/error.rs b/src/error.rs index f3399c6..7483f00 100644 --- a/src/error.rs +++ b/src/error.rs @@ -40,7 +40,7 @@ impl fmt::Display for Internal { impl IntoResponse for Internal { fn into_response(self) -> Response { let Self(id, error) = &self; - eprintln!("hi: [{id}] {error}"); + eprintln!("pilcrow: [{id}] {error}"); (StatusCode::INTERNAL_SERVER_ERROR, self.to_string()).into_response() } } @@ -1,4 +1,4 @@ -//! `hi` - a web-based, self-hosted chat system. +//! Pilcrow - a web-based, self-hosted chat system. #![warn(clippy::all)] #![warn(clippy::pedantic)] diff --git a/src/main.rs b/src/main.rs index d0830ff..427294e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use clap::Parser; -use hi::cli; +use pilcrow::cli; #[tokio::main] async fn main() -> Result<(), cli::Error> { |
