summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-07-07 20:19:12 +0200
committerDavid Härdeman <david@hardeman.nu>2020-07-07 20:19:12 +0200
commite685df91251ca111e42306e6f36835e55f052c0c (patch)
treef82cd13720c9205aa2c03ca405ef3d8fa45fea58
parentbf0d7d8c08527d7150027e1bc3ae2c8499c4ca97 (diff)
Change action verbs to be a bit more descriptive
-rw-r--r--man/minecctl.xml17
-rw-r--r--minecctl/minecctl-commands.h10
-rw-r--r--minecctl/minecctl.c12
-rw-r--r--minecctl/misc-commands.c2
-rw-r--r--minecctl/misc-commands.h2
-rw-r--r--minecctl/rcon-commands.c2
-rw-r--r--minecctl/rcon-commands.h2
7 files changed, 25 insertions, 22 deletions
diff --git a/man/minecctl.xml b/man/minecctl.xml
index c410d40..62c8925 100644
--- a/man/minecctl.xml
+++ b/man/minecctl.xml
@@ -71,21 +71,24 @@
</varlistentry>
<varlistentry>
- <term><command>status</command> <optional>SERVER</optional></term>
+ <term><command>info</command> <optional>SERVER</optional></term>
<listitem><para>
- Show the current status of <replaceable>SERVER</replaceable>
+ Show information about <replaceable>SERVER</replaceable>
(or all known servers if <replaceable>SERVER</replaceable>
- is not specified).
+ is not specified). Note that the server needs to be running.
</para></listitem>
</varlistentry>
<varlistentry>
- <term><command>ping</command> <optional>SERVER</optional></term>
+ <term><command>status</command> <optional>SERVER</optional></term>
<listitem><para>
- Check if <replaceable>SERVER</replaceable> is running
- (if <replaceable>SERVER</replaceable> is not specified, it must
+ Check if <replaceable>SERVER</replaceable> is running and reachable
+ via various methods (<acronym>rcon</acronym>,
+ <application>minecraft</application> protocol and
+ <application>systemd</application>).
+ If <replaceable>SERVER</replaceable> is not specified, it must
be defined via command line options, see options <option>-r</option>
- and <option>-m</option> below).
+ and <option>-m</option> below.
</para></listitem>
</varlistentry>
diff --git a/minecctl/minecctl-commands.h b/minecctl/minecctl-commands.h
index b946271..909c48d 100644
--- a/minecctl/minecctl-commands.h
+++ b/minecctl/minecctl-commands.h
@@ -6,8 +6,8 @@ enum commands {
CMD_INVALID = 0,
CMD_LIST,
CMD_LINT,
+ CMD_INFO,
CMD_STATUS,
- CMD_PING,
CMD_STOP,
CMD_STOPALL,
CMD_PCOUNT,
@@ -28,12 +28,12 @@ static struct command_list {
.cmd = CMD_LINT,
},
{
- .name = "status",
- .cmd = CMD_STATUS,
+ .name = "info",
+ .cmd = CMD_INFO,
},
{
- .name = "ping",
- .cmd = CMD_PING,
+ .name = "status",
+ .cmd = CMD_STATUS,
},
{
.name = "stop",
diff --git a/minecctl/minecctl.c b/minecctl/minecctl.c
index 9a43fc3..925092e 100644
--- a/minecctl/minecctl.c
+++ b/minecctl/minecctl.c
@@ -156,8 +156,8 @@ _noreturn_ static void usage(bool no_error)
"Valid commands:\n"
" list list known servers\n"
" lint check validity of server configuration files\n"
- " status [SERVER] show status of SERVER (or all known servers)\n"
- " ping [SERVER] check if SERVER is running\n"
+ " info [SERVER] show information about a running SERVER (or all known servers)\n"
+ " status [SERVER] check if SERVER (or all known servers) is running and accessible\n"
" stop [SERVER] stop SERVER\n"
" stopall stop all known servers (including ADDR)\n"
" pcount [SERVER] get player count for SERVER\n"
@@ -335,13 +335,13 @@ static void parse_command(struct cfg *cfg, char *const *argv)
}
cfg->cmd = do_stop_all;
break;
- case CMD_STATUS:
+ case CMD_INFO:
get_optional_server_arg(cfg, &argv, false);
- cfg->cmd = do_status;
+ cfg->cmd = do_info;
break;
- case CMD_PING:
+ case CMD_STATUS:
get_optional_server_arg(cfg, &argv, false);
- cfg->cmd = do_ping;
+ cfg->cmd = do_status;
break;
case CMD_STOP:
get_optional_server_arg(cfg, &argv, false);
diff --git a/minecctl/misc-commands.c b/minecctl/misc-commands.c
index 1870e07..c7c09d0 100644
--- a/minecctl/misc-commands.c
+++ b/minecctl/misc-commands.c
@@ -155,7 +155,7 @@ bool do_pcount(struct cfg *cfg)
return true;
}
-bool do_ping(struct cfg *cfg)
+bool do_status(struct cfg *cfg)
{
struct server *server;
const char *error;
diff --git a/minecctl/misc-commands.h b/minecctl/misc-commands.h
index ac2fd54..ebb6ccd 100644
--- a/minecctl/misc-commands.h
+++ b/minecctl/misc-commands.h
@@ -8,6 +8,6 @@ bool do_lint(struct cfg *cfg);
bool do_pcount(struct cfg *cfg);
-bool do_ping(struct cfg *cfg);
+bool do_status(struct cfg *cfg);
#endif
diff --git a/minecctl/rcon-commands.c b/minecctl/rcon-commands.c
index 61a682c..0c4fd7e 100644
--- a/minecctl/rcon-commands.c
+++ b/minecctl/rcon-commands.c
@@ -226,7 +226,7 @@ static bool get_one_status(int fd, char *buf, size_t len, const char *cmd,
return false;
}
-bool do_status(struct cfg *cfg)
+bool do_info(struct cfg *cfg)
{
char buf[4096];
char tbuf[4096];
diff --git a/minecctl/rcon-commands.h b/minecctl/rcon-commands.h
index 84d5529..b2ae75d 100644
--- a/minecctl/rcon-commands.h
+++ b/minecctl/rcon-commands.h
@@ -2,7 +2,7 @@
#ifndef foorconcommandshfoo
#define foorconcommandshfoo
-bool do_status(struct cfg *cfg);
+bool do_info(struct cfg *cfg);
bool do_stop(struct cfg *cfg);