Skip to content

Commit

Permalink
Better cli documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
raffomania committed Dec 12, 2023
1 parent 1cf5f2d commit c931439
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
run:
watch:
systemfd --no-pid -s http::4040 -- cargo watch -- cargo run start

ci-dev:
Expand Down
5 changes: 4 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::net::SocketAddr;

use clap::{Parser, Subcommand};

use crate::server;
Expand All @@ -12,7 +14,8 @@ struct Cli {
enum Command {
Start {
#[clap(long)]
listen: Option<String>,
/// Format: `ip:port`. If omitted, try to obtain a port via the listenfd interface.
listen: Option<SocketAddr>,
},
}

Expand Down
4 changes: 3 additions & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::net::SocketAddr;

use askama::Template;
use axum::{debug_handler, routing::get, Router};
use listenfd::ListenFd;
use tower_http::trace::TraceLayer;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter};

pub async fn start(listen_address: Option<String>) {
pub async fn start(listen_address: Option<SocketAddr>) {
tracing_subscriber::registry()
.with(EnvFilter::from(
"linkblocks=debug,tower_http=debug,axum::rejection=trace",
Expand Down

0 comments on commit c931439

Please sign in to comment.