diff options
author | Kalle Wallin <kaw@linux.se> | 2004-03-20 08:44:53 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-03-20 08:44:53 +0000 |
commit | 9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325 (patch) | |
tree | 12866f2387f6156c1639cfcc8c12905ef0915a4f | |
parent | 362c73b143bc8bc1bb3658309fcf4737af0c8000 (diff) | |
download | mpd-9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325.tar.gz mpd-9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325.tar.xz mpd-9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325.zip |
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
Diffstat (limited to '')
-rw-r--r-- | options.c | 5 | ||||
-rw-r--r-- | options.h | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -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; } @@ -7,6 +7,8 @@ typedef struct { char *host; int port; + int reconnect; + int debug; } options_t; |