aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-20 08:44:53 +0000
committerKalle Wallin <kaw@linux.se>2004-03-20 08:44:53 +0000
commit9747e6e4a58ffcdbbc7fc14f6a1c21735ce14325 (patch)
tree12866f2387f6156c1639cfcc8c12905ef0915a4f
parent362c73b143bc8bc1bb3658309fcf4737af0c8000 (diff)
downloadmpd-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.c5
-rw-r--r--options.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/options.c b/options.c
index 33de4c05a..03fe3eea9 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 7bf43de95..143be3b2d 100644
--- a/options.h
+++ b/options.h
@@ -7,6 +7,8 @@ typedef struct
{
char *host;
int port;
+ int reconnect;
+ int debug;
} options_t;