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"
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,24 +14,35 @@ 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"
short: i
help: "if the server's favicon should be printed as ASCII art"
- color:
short: c
help: "if the favicon image should be printed with ANSI color formatting or monochrome"
short: c
help: "if the favicon image should be printed with ANSI color formatting or monochrome"
- size:
short: s
help: "the size of the image"
takes_value: true
default_value: "16"
short: s
help: "the size of the image"
takes_value: true
default_value: "16"
- deep:
short: d
help: "if provided the ascii image will have more different characters"
short: d
help: "if provided the ascii image will have more different characters"
- invert:
short: n
help: "inverts the ascii image thickness"
short: n
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 {
let stdout = std::io::stdout();
let mut handle = stdout.lock();
handle.write_all(&[b'\n'])?;
handle.write_all(&img.await?)?;
}
//endregion