From 16c2db5c78493c70d0cfff9b7c6228c7b980fad7 Mon Sep 17 00:00:00 2001 From: Tiiffi Date: Mon, 21 Oct 2019 21:35:38 +0300 Subject: [PATCH] Tidy up man page and usage text --- mcrcon.1 | 27 ++++++++++++++------------- mcrcon.c | 27 ++++++++++++++------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/mcrcon.1 b/mcrcon.1 index 39ccf49..b0d83de 100644 --- a/mcrcon.1 +++ b/mcrcon.1 @@ -3,7 +3,7 @@ .\" .TH MCRCON 1 "October 2019" "Version 0.6.2" .SH NAME -mcrcon \- sends rcon commands to a Minecraft server +mcrcon \- send rcon commands to a Minecraft server .SH SYNOPSIS .B mcrcon [ options @@ -11,31 +11,32 @@ options commands .B ] .SH DESCRIPTION -mcrcon is Minecraft rcon client / terminal with bukkit coloring support. -It is well suited for remote administration and server maintenance scripts. +mcrcon is Minecraft rcon client for remote administration and server maintenance scripts. .SH OPTIONS -.IP -h -Print usage .IP -H -Server address (default is localhost) +Server address (default: localhost) .IP -P -Port (default is 25575) +Port (default: 25575) .IP -p Rcon password .IP -t -Interactive terminal mode +Terminal mode .IP -s -Silent mode (do not print received packets) +Silent mode .IP -c Disable colors .IP -r -Output raw packets (for debugging and custom handling) +Output raw packets +.IP -h +Print usage .IP -v Output version information .PP -Commands with arguments must be enclosed in quotes. +Commands with spaces must be enclosed in quotes. +.br +mcrcon will start in terminal mode if no commands are given. .SH ENVIRONMENTAL VARIABLES -Server address, port and password can be set using following environment variables: +Server address, port and password can be set with following environment variables: .PP \fBMCRCON_HOST .br @@ -55,7 +56,7 @@ Send "weather clear" command to server using custom port 1337 \fBmcrcon\fR -H my.minecraft.server -P 1337 -p password "weather clear" .RE .PP -Send three commands to server (say, save-all and stop) +Send three commands to server ("say", "save-all" and "stop") .RS \fBmcrcon\fR -H my.minecraft.server -p password "say Server is restarting!" save-all stop .RE diff --git a/mcrcon.c b/mcrcon.c index fdd32c8..2c07293 100644 --- a/mcrcon.c +++ b/mcrcon.c @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) if (pass == NULL) { - fputs("Password not defined (-p flag). Try 'mcrcon -h' or 'man mcrcon' for more information.\n\n", stdout); + fputs("You must give password (-p password). Try 'mcrcon -h' or 'man mcrcon' for help.\n\n", stdout); return 0; } @@ -236,27 +236,28 @@ int main(int argc, char *argv[]) void usage(void) { fputs( - "Usage: "IN_NAME" [OPTIONS]... [COMMANDS]...\n\n" - "Sends rcon commands to Minecraft server.\n\n" - "Option:\n" - " -h\t\tPrint usage\n" - " -H\t\tServer address (default is localhost)\n" - " -P\t\tPort (default is 25575)\n" + "Usage: "IN_NAME" [OPTIONS] [COMMANDS]\n\n" + "Send rcon commands to Minecraft server.\n\n" + "Options:\n" + " -H\t\tServer address (default: localhost)\n" + " -P\t\tPort (default: 25575)\n" " -p\t\tRcon password\n" - " -t\t\tInteractive terminal mode\n" - " -s\t\tSilent mode (do not print received packets)\n" + " -t\t\tTerminal mode\n" + " -s\t\tSilent mode\n" " -c\t\tDisable colors\n" - " -r\t\tOutput raw packets (debugging and custom handling)\n" - " -v\t\tOutput version information\n\n" - "Server address, port and password can be set using following environment variables:\n" + " -r\t\tOutput raw packets\n" + " -h\t\tPrint usage\n" + " -v\t\tVersion information\n\n" + "Server address, port and password can be set with following environment variables:\n" " MCRCON_HOST\n" " MCRCON_PORT\n" " MCRCON_PASS\n\n" ,stdout ); + puts("mcrcon will start in terminal mode if no commands are given."); puts("Command-line options will override environment variables."); - puts("Rcon commands with arguments must be enclosed in quotes.\n"); + puts("Rcon commands with spaces must be enclosed in quotes.\n"); puts("Example:\n\t"IN_NAME" -H my.minecraft.server -p password \"say Server is restarting!\" save-all stop\n"); puts(VER_STR"\nReport bugs to tiiffi+mcrcon at gmail or https://github.com/Tiiffi/mcrcon/issues/\n");