diff options
Diffstat (limited to 'src/cli.rs')
| -rw-r--r-- | src/cli.rs | 33 |
1 files changed, 17 insertions, 16 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. |
