summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-06-27 20:22:43 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-06-27 20:22:43 +0000
commit75543048b50d053a208a37a0dfe25802cfee4f6f (patch)
tree0885de0cee3437f7dbe14855ba7886ebc0c29437
parent03e249a27d480b3a00c3337ca1730548d2acec09 (diff)
downloadirssi-75543048b50d053a208a37a0dfe25802cfee4f6f.zip
Added -v / --version command line option. Moved POPT_AUTOHELP option to
fe-common from fe-text. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1574 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-common/core/fe-common-core.c15
-rw-r--r--src/fe-text/irssi.c7
2 files changed, 15 insertions, 7 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index 8cfb3a85..37c4163f 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -24,6 +24,7 @@
#include "misc.h"
#include "levels.h"
#include "settings.h"
+#include "irssi-version.h"
#include "channels.h"
#include "servers-setup.h"
@@ -96,6 +97,12 @@ void window_commands_deinit(void);
void fe_core_commands_init(void);
void fe_core_commands_deinit(void);
+static void print_version(void)
+{
+ printf(PACKAGE" " IRSSI_VERSION"\n");
+ exit(0);
+}
+
static void sig_connected(SERVER_REC *server)
{
MODULE_DATA_SET(server, g_new0(MODULE_SERVER_REC, 1));
@@ -118,7 +125,15 @@ static void sig_channel_destroyed(CHANNEL_REC *channel)
void fe_common_core_init(void)
{
+ static struct poptOption version_options[] = {
+ { NULL, '\0', POPT_ARG_CALLBACK, (void *)&print_version, '\0', NULL },
+ { "version", 'v', POPT_ARG_NONE, NULL, 0, "Display irssi version" },
+ { NULL, '\0', 0, NULL }
+ };
+
static struct poptOption options[] = {
+ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, version_options, 0, NULL, NULL },
+ POPT_AUTOHELP
{ "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/ircnet", "SERVER" },
{ "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "SERVER" },
{ "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" },
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index 71039a79..11a42665 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -102,13 +102,6 @@ void irssi_redraw(void)
static void textui_init(void)
{
- static struct poptOption options[] = {
- POPT_AUTOHELP
- { NULL, '\0', 0, NULL }
- };
-
- args_register(options);
-
irssi_gui = IRSSI_GUI_TEXT;
core_init();
irc_init();