improve arguments

add new line before favicon
This commit is contained in:
LordMZTE 2020-09-12 15:53:19 +02:00
parent acc5a7b8b1
commit dcd073f7ba
2 changed files with 25 additions and 15 deletions

View file

@ -2,13 +2,11 @@ name: "mcstat"
about: "queries information about a minecraft server" about: "queries information about a minecraft server"
args: args:
- ip: - ip:
value_name: "IP_ADDRESS"
help: "the ip of the server to ping" help: "the ip of the server to ping"
takes_value: true takes_value: true
index: 1 index: 1
required: true required: true
- port: - port:
value_name: "PORT"
help: "the port of the server" help: "the port of the server"
long: "port" long: "port"
short: p short: p
@ -16,24 +14,35 @@ args:
takes_value: true takes_value: true
- protocol-version: - protocol-version:
long: "protocol" long: "protocol"
value_name: "PROTOCOL_VERSION"
help: "the protocol version to use" help: "the protocol version to use"
default_value: "751" default_value: "751"
takes_value: true takes_value: true
# IMAGE ARGS
- image: - image:
short: i short: i
help: "if the server's favicon should be printed as ASCII art" help: "if the server's favicon should be printed as ASCII art"
- color: - color:
short: c short: c
help: "if the favicon image should be printed with ANSI color formatting or monochrome" help: "if the favicon image should be printed with ANSI color formatting or monochrome"
- size: - size:
short: s short: s
help: "the size of the image" help: "the size of the image"
takes_value: true takes_value: true
default_value: "16" default_value: "16"
- deep: - deep:
short: d short: d
help: "if provided the ascii image will have more different characters" help: "if provided the ascii image will have more different characters"
- invert: - invert:
short: n short: n
help: "inverts the ascii image thickness" help: "inverts the ascii image thickness"
groups:
- img-flags:
requires: "image"
multiple: true
args:
- color
- size
- deep
- invert

View file

@ -107,6 +107,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
if let Some(img) = image { if let Some(img) = image {
let stdout = std::io::stdout(); let stdout = std::io::stdout();
let mut handle = stdout.lock(); let mut handle = stdout.lock();
handle.write_all(&[b'\n'])?;
handle.write_all(&img.await?)?; handle.write_all(&img.await?)?;
} }
//endregion //endregion