mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
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
This commit is contained in:
parent
03e249a27d
commit
75543048b5
@ -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" },
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user