improve runtime docs
This commit is contained in:
parent
04dd8e58ba
commit
bac3204572
4 changed files with 14 additions and 6 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -118,7 +118,7 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mcstatusface"
|
name = "mcstatusface"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -4,7 +4,7 @@ authors = ["ari melody <ari@arimelody.me>"]
|
||||||
repository = "https://git.arimelody.me/ari/mcstatusface"
|
repository = "https://git.arimelody.me/ari/mcstatusface"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
keywords = ["minecraft", "server", "query", "web"]
|
keywords = ["minecraft", "server", "query", "web"]
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -5,9 +5,9 @@ convenient format!
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
McStatusFace can be run as a web server with `./mcstatusface serve`. This will
|
McStatusFace can be run as a web server with `mcstatusface serve`. This will
|
||||||
provide server information in JSON format to requests on `GET /?s=<address[:port]>`.
|
provide server information in JSON format to requests on `GET /?s=<address[:port]>`.
|
||||||
(e.g. `curl -sS "127.0.0.1:8080?s=127.0.0.1:25565" | jq .`)
|
(e.g. `curl -sS "127.0.0.1:8080?s=127.0.0.1:25565" | jq .`)
|
||||||
|
|
||||||
Alternatively, you can simply run `./mcstatusface <address[:port]>`, and the
|
Alternatively, you can simply run `mcstatusface <address[:port]>`, and the
|
||||||
tool will provide server details in plain-text format.
|
tool will provide server details in plain-text format.
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -8,8 +8,16 @@ use mcstatusface::{MinecraftStatus};
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
if args.len() < 2 {
|
if args.len() < 2 {
|
||||||
eprintln!("Usage: {} [serve] <address[:port]>", args[0]);
|
println!(
|
||||||
std::process::exit(1);
|
r#"Crafty McStatusFace, v{} - made with <3 by ari melody
|
||||||
|
|
||||||
|
Host a web API:
|
||||||
|
$ mcstatusface serve [address[:port]]
|
||||||
|
|
||||||
|
Query a server:
|
||||||
|
$ mcstatusface <address[:port]>"#,
|
||||||
|
env!("CARGO_PKG_VERSION"));
|
||||||
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if args[1] != "serve" {
|
if args[1] != "serve" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue