summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-08 17:28:48 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-08 17:28:48 -0500
commit7a26a75506de82ba1e2e0567f8f96fc2784874e9 (patch)
tree54d696bce7f64590f1d24bf496f55813a0e311b6 /src
parentb66bded4c90437503a25fe89e16d15422029dc0b (diff)
Rename the project to `pilcrow`.
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs33
-rw-r--r--src/error.rs2
-rw-r--r--src/lib.rs2
-rw-r--r--src/main.rs2
4 files changed, 20 insertions, 19 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 308294d..0d448d2 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -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()
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 84b8dfc..765e625 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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> {