mirror of
https://github.com/LordMZTE/mcstat.git
synced 2024-05-07 06:51:11 +02:00
improve arguments
add new line before favicon
This commit is contained in:
parent
acc5a7b8b1
commit
dcd073f7ba
15
src/args.yml
15
src/args.yml
|
@ -2,13 +2,11 @@ name: "mcstat"
|
|||
about: "queries information about a minecraft server"
|
||||
args:
|
||||
- ip:
|
||||
value_name: "IP_ADDRESS"
|
||||
help: "the ip of the server to ping"
|
||||
takes_value: true
|
||||
index: 1
|
||||
required: true
|
||||
- port:
|
||||
value_name: "PORT"
|
||||
help: "the port of the server"
|
||||
long: "port"
|
||||
short: p
|
||||
|
@ -16,10 +14,11 @@ args:
|
|||
takes_value: true
|
||||
- protocol-version:
|
||||
long: "protocol"
|
||||
value_name: "PROTOCOL_VERSION"
|
||||
help: "the protocol version to use"
|
||||
default_value: "751"
|
||||
takes_value: true
|
||||
|
||||
# IMAGE ARGS
|
||||
- image:
|
||||
short: i
|
||||
help: "if the server's favicon should be printed as ASCII art"
|
||||
|
@ -37,3 +36,13 @@ args:
|
|||
- invert:
|
||||
short: n
|
||||
help: "inverts the ascii image thickness"
|
||||
|
||||
groups:
|
||||
- img-flags:
|
||||
requires: "image"
|
||||
multiple: true
|
||||
args:
|
||||
- color
|
||||
- size
|
||||
- deep
|
||||
- invert
|
||||
|
|
|
@ -107,6 +107,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
|||
if let Some(img) = image {
|
||||
let stdout = std::io::stdout();
|
||||
let mut handle = stdout.lock();
|
||||
handle.write_all(&[b'\n'])?;
|
||||
handle.write_all(&img.await?)?;
|
||||
}
|
||||
//endregion
|
||||
|
|
Loading…
Reference in a new issue