From 9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sat, 20 Mar 2004 08:44:53 +0000 Subject: [PATCH] Added option --exit wich disables automatic reconnection and exits if the connection to the server is lost. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@321 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- options.c | 5 +++++ options.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/options.c b/options.c index 33de4c0..03fe3ee 100644 --- a/options.c +++ b/options.c @@ -21,6 +21,7 @@ static struct poptOption optionsTable[] = { #endif { "version", 'V', 0, 0, 'V', "Display version information." }, { "keys", 'k', 0, 0, 'k', "Display key bindings." }, + { "exit", 'e', 0, 0, 'e', "Exit on connection errors." }, { "port", 'p', POPT_ARG_INT, &options.port, 0, "Connect to server on port [" DEFAULT_PORT_STR "].", "PORT" }, { "host", 'h', POPT_ARG_STRING, &options.host, 0, @@ -60,6 +61,9 @@ options_parse( int argc, char **argv ) case 'k': command_dump_keys(); exit(EXIT_SUCCESS); + case 'e': + options.reconnect = 0; + break; default: fprintf(stderr, "%s: %s\n", poptBadOption(optCon, POPT_BADOPTION_NOALIAS), @@ -97,6 +101,7 @@ options_init( void ) options.port = atoi(value); else options.port = DEFAULT_PORT; + options.reconnect = 1; } diff --git a/options.h b/options.h index 7bf43de..143be3b 100644 --- a/options.h +++ b/options.h @@ -7,6 +7,8 @@ typedef struct { char *host; int port; + int reconnect; + int debug; } options_t; -- 2.30.2