Code

colors: make color support optional at compile time
[ncmpc.git] / src / options.c
index 421eda7d86c65c1c9ad5cde1d797c4bba22b8cf8..1b592a567fa39e0035144255b081a7e96371ae2b 100644 (file)
 #include "options.h"
 #include "config.h"
 #include "defaults.h"
-#include "support.h"
+#include "charset.h"
 #include "command.h"
 #include "conf.h"
 
 #include <stdlib.h>
 #include <string.h>
+#include <glib.h>
 
 #define MAX_LONGOPT_LENGTH 32
 
@@ -142,33 +143,42 @@ handle_option(int c, const char *arg)
                display_help();
                exit(EXIT_SUCCESS);
        case 'V': /* --version */
-               printf("%s version: %s\n", PACKAGE, VERSION);
-               printf("build options:");
+               puts(PACKAGE " version: " VERSION "\n"
+                    "build options:"
 #ifndef NDEBUG
-               printf(" debug");
+                    " debug"
 #endif
 #ifdef ENABLE_NLS
-               printf(" nls");
+                    " nls"
+#endif
+#ifdef ENABLE_COLORS
+                    " colors"
+#else
+                    " no-colors"
 #endif
 #ifdef HAVE_GETMOUSE
-               printf(" getmouse");
+                    " getmouse"
 #endif
 #ifdef ENABLE_ARTIST_SCREEN
-               printf(" artist-screen");
+                    " artist-screen"
 #endif
 #ifdef ENABLE_SEARCH_SCREEN
-               printf(" search-screen");
+                    " search-screen"
 #endif
 #ifdef ENABLE_KEYDEF_SCREEN
-               printf(" key-screen");
+                    " key-screen"
 #endif
-               printf("\n");
+                    "\n");
                exit(EXIT_SUCCESS);
        case 'c': /* --colors */
+#ifdef ENABLE_COLORS
                options.enable_colors = true;
+#endif
                break;
        case 'C': /* --no-colors */
+#ifdef ENABLE_COLORS
                options.enable_colors = false;
+#endif
                break;
        case 'm': /* --mouse */
                options.enable_mouse = true;
@@ -305,7 +315,7 @@ options_parse(int argc, const char *argv[])
 }
 
 options_t *
-options_init( void )
+options_init(void)
 {
        const char *value;
        char *tmp;