mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Move 'version' option in main.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4511 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
841cd8d0cf
commit
24bf34c6ca
@ -24,7 +24,6 @@
|
|||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "levels.h"
|
#include "levels.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "irssi-version.h"
|
|
||||||
#ifdef HAVE_NL_LANGINFO
|
#ifdef HAVE_NL_LANGINFO
|
||||||
# include <langinfo.h>
|
# include <langinfo.h>
|
||||||
#endif
|
#endif
|
||||||
@ -99,13 +98,6 @@ void window_commands_deinit(void);
|
|||||||
|
|
||||||
static void sig_setup_changed(void);
|
static void sig_setup_changed(void);
|
||||||
|
|
||||||
static void print_version(void)
|
|
||||||
{
|
|
||||||
printf(PACKAGE" " IRSSI_VERSION" (%d %04d)\n",
|
|
||||||
IRSSI_VERSION_DATE, IRSSI_VERSION_TIME);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sig_connected(SERVER_REC *server)
|
static void sig_connected(SERVER_REC *server)
|
||||||
{
|
{
|
||||||
MODULE_DATA_SET(server, g_new0(MODULE_SERVER_REC, 1));
|
MODULE_DATA_SET(server, g_new0(MODULE_SERVER_REC, 1));
|
||||||
@ -133,14 +125,7 @@ static void sig_channel_destroyed(CHANNEL_REC *channel)
|
|||||||
|
|
||||||
void fe_common_core_register_options(void)
|
void fe_common_core_register_options(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[] = {
|
static struct poptOption options[] = {
|
||||||
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, version_options, 0, NULL, NULL },
|
|
||||||
POPT_AUTOHELP
|
POPT_AUTOHELP
|
||||||
{ "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/network", "SERVER" },
|
{ "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/network", "SERVER" },
|
||||||
{ "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" },
|
{ "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "PASSWORD" },
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "gui-windows.h"
|
#include "gui-windows.h"
|
||||||
#include "textbuffer-reformat.h"
|
#include "textbuffer-reformat.h"
|
||||||
|
#include "irssi-version.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
@ -327,8 +328,10 @@ GMemVTable gc_mem_table = {
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
static int version = 0;
|
||||||
static struct poptOption options[] = {
|
static struct poptOption options[] = {
|
||||||
{ "dummy", 'd', POPT_ARG_NONE, &dummy, 0, "Use the dummy terminal mode", NULL },
|
{ "dummy", 'd', POPT_ARG_NONE, &dummy, 0, "Use the dummy terminal mode", NULL },
|
||||||
|
{ "version", 'v', POPT_ARG_NONE, &version, 0, "Display irssi version", NULL },
|
||||||
{ NULL, '\0', 0, NULL }
|
{ NULL, '\0', 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -337,6 +340,12 @@ int main(int argc, char **argv)
|
|||||||
args_register(options);
|
args_register(options);
|
||||||
args_execute(argc, argv);
|
args_execute(argc, argv);
|
||||||
|
|
||||||
|
if (version) {
|
||||||
|
printf(PACKAGE" " IRSSI_VERSION" (%d %04d)\n",
|
||||||
|
IRSSI_VERSION_DATE, IRSSI_VERSION_TIME);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_GC
|
#ifdef USE_GC
|
||||||
g_mem_set_vtable(&gc_mem_table);
|
g_mem_set_vtable(&gc_mem_table);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user