aboutsummaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-25 11:44:59 +0000
committerKalle Wallin <kaw@linux.se>2004-03-25 11:44:59 +0000
commit268b0823860274d6079c5dd307770a0769d404ef (patch)
tree25dea360c739fca9ad931caa1f1aab320770338e /options.c
parent6777db4e48d23b9841ebd5e081c8dd3f4437a586 (diff)
downloadmpd-268b0823860274d6079c5dd307770a0769d404ef.tar.gz
mpd-268b0823860274d6079c5dd307770a0769d404ef.tar.xz
mpd-268b0823860274d6079c5dd307770a0769d404ef.zip
Added support for a configuration file ~/.ncmpcrc and color support.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@473 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'options.c')
-rw-r--r--options.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/options.c b/options.c
index 9685ce3b2..8f684a108 100644
--- a/options.c
+++ b/options.c
@@ -1,19 +1,15 @@
-/*
- * $Id: options.c,v 1.7 2004/03/17 11:34:36 kalle Exp $
- *
- */
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
+#include <ncurses.h>
#include <popt.h>
#include "config.h"
#include "options.h"
#include "command.h"
-static options_t options;
+options_t options;
static struct poptOption optionsTable[] = {
#ifdef DEBUG
@@ -21,6 +17,8 @@ static struct poptOption optionsTable[] = {
#endif
{ "version", 'V', 0, 0, 'V', "Display version information." },
{ "keys", 'k', 0, 0, 'k', "Display key bindings." },
+ { "colors", 'c', 0, 0, 'c', "Enable colors." },
+ { "no-colors", 'C', 0, 0, 'C', "Disable colors." },
{ "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" },
@@ -55,6 +53,12 @@ options_parse( int argc, const char **argv)
options.debug = 1;
break;
#endif
+ case 'c':
+ options.enable_colors = 1;
+ break;
+ case 'C':
+ options.enable_colors = 0;
+ break;
case 'V':
printf("Version " VERSION "\n");
exit(EXIT_SUCCESS);
@@ -87,7 +91,7 @@ options_parse( int argc, const char **argv)
return &options;
}
-void
+options_t *
options_init( void )
{
char *value;
@@ -102,6 +106,16 @@ options_init( void )
else
options.port = DEFAULT_PORT;
options.reconnect = 1;
+
+ options.bg_color = COLOR_BLACK;
+ options.title_color = COLOR_BLUE;
+ options.line_color = COLOR_GREEN;
+ options.list_color = COLOR_YELLOW;
+ options.progress_color = COLOR_GREEN;
+ options.status_color = COLOR_RED;
+ options.alert_color = COLOR_MAGENTA;;
+
+ return &options;
}