Checkpoint
This commit is contained in:
+22
-5
@@ -45,6 +45,21 @@
|
||||
//! ```shell
|
||||
//! $ cargo run -- start [TOKEN]
|
||||
//! ```
|
||||
//!
|
||||
//! # Running the Documentation Server
|
||||
//!
|
||||
//! Payphone has a built-in documentation server that serves the project's documentation and
|
||||
//! refreshes it on changes. To start the documentation server, run the following command:
|
||||
//!
|
||||
//! ```shell
|
||||
//! $ cargo run -- docs --open
|
||||
//! ```
|
||||
//!
|
||||
//! The `--open` flag is optional and will open the documentation in the default browser after
|
||||
//! starting the server. You can also use the `--bind` argument to specify the address to bind the
|
||||
//! server to, which defaults to `0.0.0.0:3000`.
|
||||
|
||||
use std::net::SocketAddr;
|
||||
|
||||
/// Payphone's argument parser.
|
||||
#[derive(clap::Parser)]
|
||||
@@ -129,16 +144,18 @@ pub enum Commands {
|
||||
/// Starts a documentation server for the project which serves `cargo doc` and refreshes on
|
||||
/// changes.
|
||||
Docs {
|
||||
/// The port to run the documentation server on.
|
||||
/// The address to run the documentation server on.
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
env = "PAYPHONE_DOCS_PORT",
|
||||
value_name = "PORT",
|
||||
default_value_t = 3000
|
||||
env = "PAYPHONE_DOCS_ADDR",
|
||||
value_name = "ADDR",
|
||||
default_value_t = SocketAddr::from(([0, 0, 0, 0], 3000))
|
||||
)]
|
||||
port: u16,
|
||||
bind: SocketAddr,
|
||||
|
||||
/// When this flag is set, the documentation server will open the documentation in the
|
||||
/// default browser after starting the server.
|
||||
#[arg(
|
||||
long,
|
||||
short,
|
||||
|
||||
Reference in New Issue
Block a user