1
0
Fork 0
forked from murx/murx

Added -v and --version to show the program version. 1.0 today! :)

This commit is contained in:
Johannes Findeisen 2026-11-21 12:16:50 +01:00
commit c2e697b9f7
6 changed files with 45 additions and 20 deletions

10
murx.c
View file

@ -33,7 +33,8 @@
* One binary, no config file. Shortcuts and the interface palette have built-in defaults.
*
* murx [session] attach to session (default "0"), or start it
* murx -h|--help show usage and all Ctrl-A shortcut chains
* murx -h|--help show version, usage and all Ctrl-A shortcut chains
* murx -v|--version show version
*
* Pure C99 + POSIX (macOS / Linux / FreeBSD / OpenBSD).
*/
@ -85,6 +86,7 @@
#define MURX_NOIPA
#endif
#define MURX_VERSION "1.0"
#define DEFAULT_PREFIX 0x01
/* client -> server */
@ -4353,9 +4355,11 @@ static int run_client(int fd, const char *name, unsigned char prefix, int status
static void print_help(FILE *out) {
fprintf(out,
"murx " MURX_VERSION "\n\n"
"usage: murx [-p letter] [-s top|bottom] [-c RRGGBB] [--cwd] [--clock] [--murx] [--hostname] [session]\n"
" murx -l | --list-sessions\n"
" murx -h | --help\n"
" murx -v | --version\n"
"\n"
"Attach to a running session, or start it if it is not running.\n"
"The session name defaults to \"0\".\n"
@ -4458,6 +4462,10 @@ int main(int argc, char **argv) {
print_help(stdout);
return 0;
}
if (strcmp(option, "-v") == 0 || strcmp(option, "--version") == 0) {
puts("murx " MURX_VERSION);
return 0;
}
if (strcmp(option, "-l") == 0 || strcmp(option, "--list-sessions") == 0) {
list = 1;
} else if (strcmp(option, "--cwd") == 0) {