Tidy up man page and usage text

This commit is contained in:
Tiiffi
2019-10-21 21:35:38 +03:00
parent 8f561f803a
commit 16c2db5c78
2 changed files with 28 additions and 26 deletions

View File

@ -3,7 +3,7 @@
.\" .\"
.TH MCRCON 1 "October 2019" "Version 0.6.2" .TH MCRCON 1 "October 2019" "Version 0.6.2"
.SH NAME .SH NAME
mcrcon \- sends rcon commands to a Minecraft server mcrcon \- send rcon commands to a Minecraft server
.SH SYNOPSIS .SH SYNOPSIS
.B mcrcon [ .B mcrcon [
options options
@ -11,31 +11,32 @@ options
commands commands
.B ] .B ]
.SH DESCRIPTION .SH DESCRIPTION
mcrcon is Minecraft rcon client / terminal with bukkit coloring support. mcrcon is Minecraft rcon client for remote administration and server maintenance scripts.
It is well suited for remote administration and server maintenance scripts.
.SH OPTIONS .SH OPTIONS
.IP -h
Print usage
.IP -H .IP -H
Server address (default is localhost) Server address (default: localhost)
.IP -P .IP -P
Port (default is 25575) Port (default: 25575)
.IP -p .IP -p
Rcon password Rcon password
.IP -t .IP -t
Interactive terminal mode Terminal mode
.IP -s .IP -s
Silent mode (do not print received packets) Silent mode
.IP -c .IP -c
Disable colors Disable colors
.IP -r .IP -r
Output raw packets (for debugging and custom handling) Output raw packets
.IP -h
Print usage
.IP -v .IP -v
Output version information Output version information
.PP .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 .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 .PP
\fBMCRCON_HOST \fBMCRCON_HOST
.br .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" \fBmcrcon\fR -H my.minecraft.server -P 1337 -p password "weather clear"
.RE .RE
.PP .PP
Send three commands to server (say, save-all and stop) Send three commands to server ("say", "save-all" and "stop")
.RS .RS
\fBmcrcon\fR -H my.minecraft.server -p password "say Server is restarting!" save-all stop \fBmcrcon\fR -H my.minecraft.server -p password "say Server is restarting!" save-all stop
.RE .RE

View File

@ -188,7 +188,7 @@ int main(int argc, char *argv[])
if (pass == NULL) 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; return 0;
} }
@ -236,27 +236,28 @@ int main(int argc, char *argv[])
void usage(void) void usage(void)
{ {
fputs( fputs(
"Usage: "IN_NAME" [OPTIONS]... [COMMANDS]...\n\n" "Usage: "IN_NAME" [OPTIONS] [COMMANDS]\n\n"
"Sends rcon commands to Minecraft server.\n\n" "Send rcon commands to Minecraft server.\n\n"
"Option:\n" "Options:\n"
" -h\t\tPrint usage\n" " -H\t\tServer address (default: localhost)\n"
" -H\t\tServer address (default is localhost)\n" " -P\t\tPort (default: 25575)\n"
" -P\t\tPort (default is 25575)\n"
" -p\t\tRcon password\n" " -p\t\tRcon password\n"
" -t\t\tInteractive terminal mode\n" " -t\t\tTerminal mode\n"
" -s\t\tSilent mode (do not print received packets)\n" " -s\t\tSilent mode\n"
" -c\t\tDisable colors\n" " -c\t\tDisable colors\n"
" -r\t\tOutput raw packets (debugging and custom handling)\n" " -r\t\tOutput raw packets\n"
" -v\t\tOutput version information\n\n" " -h\t\tPrint usage\n"
"Server address, port and password can be set using following environment variables:\n" " -v\t\tVersion information\n\n"
"Server address, port and password can be set with following environment variables:\n"
" MCRCON_HOST\n" " MCRCON_HOST\n"
" MCRCON_PORT\n" " MCRCON_PORT\n"
" MCRCON_PASS\n\n" " MCRCON_PASS\n\n"
,stdout ,stdout
); );
puts("mcrcon will start in terminal mode if no commands are given.");
puts("Command-line options will override environment variables."); 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("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"); puts(VER_STR"\nReport bugs to tiiffi+mcrcon at gmail or https://github.com/Tiiffi/mcrcon/issues/\n");