diff --git a/src/options.c b/src/options.c
index 94da5b8369dee552f5e7ea8559995e68c7ee642b..4f1100f9d9f0ce2fed50b9f4eea25d5c32d4f647 100644 (file)
--- a/src/options.c
+++ b/src/options.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <ncurses.h>
#include <glib.h>
#include "config.h"
#include "ncmpc.h"
#include "support.h"
#include "options.h"
+#include "command.h"
+#include "conf.h"
#define MAX_LONGOPT_LENGTH 32
{ 'V', "version", NULL, "Display version information" },
{ 'c', "colors", NULL, "Enable colors" },
{ 'C', "no-colors", NULL, "Disable colors" },
+#ifdef HAVE_GETMOUSE
+ { 'm', "mouse", NULL, "Enable mouse" },
+ { 'M', "no-mouse", NULL, "Disable mouse" },
+#endif
{ 'e', "exit", NULL, "Exit on connection errors" },
{ 'p', "port", "PORT", "Connect to server on port [" DEFAULT_PORT_STR "]" },
{ 'h', "host", "HOST", "Connect to server on host [" DEFAULT_HOST "]" },
{ 'f', "config", "FILE", "Read configuration from file" },
{ 'k', "key-file","FILE", "Read configuration from file" },
#ifdef DEBUG
+ { 'K', "dump-keys", NULL, "Dump key bindings to stdout" },
{ 'D', "debug", NULL, "Enable debug output on stderr" },
#endif
{ 0, NULL, NULL, NULL },
display_help();
exit(EXIT_SUCCESS);
case 'V': /* --version */
- printf("Version %s\n", VERSION);
+ printf("%s version: %s\n", PACKAGE, VERSION);
+ printf("build options:");
+#ifdef DEBUG
+ printf(" debug");
+#endif
+#ifdef ENABLE_NLS
+ printf(" nls");
+#endif
+#ifdef ENABLE_KEYDEF_SCREEN
+ printf(" key-screen");
+#endif
+#ifdef ENABLE_CLOCK_SCREEN
+ printf(" clock-screen");
+#endif
+ printf("\n");
exit(EXIT_SUCCESS);
case 'c': /* --colors */
options.enable_colors = TRUE;
case 'C': /* --no-colors */
options.enable_colors = FALSE;
break;
+ case 'm': /* --mouse */
+ options.enable_mouse = TRUE;
+ break;
+ case 'M': /* --no-mouse */
+ options.enable_mouse = FALSE;
+ break;
case 'e': /* --exit */
options.reconnect = FALSE;
break;
g_free(options.key_file);
options.key_file = g_strdup(arg);
break;
+#ifdef DEBUG
+ case 'K': /* --dump-keys */
+ read_configuration(&options);
+ write_key_bindings(stdout, KEYDEF_WRITE_ALL | KEYDEF_COMMENT_ALL);
+ exit(EXIT_SUCCESS);
+ break;
case 'D': /* --debug */
options.debug = TRUE;
break;
+#endif
default:
fprintf(stderr,"Unknown Option %c = %s\n", c, arg);
break;
options.find_wrap = TRUE;
options.wide_cursor = TRUE;
options.audible_bell = TRUE;
+ options.crossfade_time = DEFAULT_CROSSFADE_TIME;
return &options;
}