From a4eb2c3040079891005a3da6841d514415221890 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 11 Sep 2001 13:13:03 +0000 Subject: [PATCH] support for new -version command line option git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2725 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 10 ++++ config/lyxinclude.m4 | 5 +- configure.in | 46 +++++++++++------ lyx.man | 3 ++ po/POTFILES.in | 114 +++++++++++++++++++++---------------------- src/ChangeLog | 8 +++ src/lyx_main.C | 17 ++++++- 7 files changed, 128 insertions(+), 75 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d5fc4909e..94a3ad0319 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-09-10 Jean-Marc Lasgouttes + + * lyxinclude.m4: + * configure.in: add VERSION_INFO to config.h + (from a first proposal by Rob Lahaye) + +2001-09-08 Rob Lahaye + + * lyx.man: add -version commandline flag + 2001-08-19 John Levon * configure.in: output new qt2 makefiles diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 509898034b..cc8d2a3ab0 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -212,6 +212,8 @@ dnl normal versions of a library), tasteless as that idea is. CXXFLAGS= dnl Check the version of g++ gxx_version=`${CXX} --version` + dnl Useful for global version info + CXX_VERSION="($gxx_version)" AC_PROG_CXX_G if test "$ac_test_CXXFLAGS" = set; then @@ -560,6 +562,7 @@ changequote([,]) esac lyx_cv_xpmversion="$lyx_cv_xpmv.$lyx_cv_xpmr$lyxxpmv_alpha" rm -f conftest*]) + XPM_VERSION=${lyx_cv_xpmversion} case "$lyx_cv_xpmr" in changequote(,) [789]|[0-9][0-9]*) ;; @@ -605,6 +608,7 @@ lyx_cv_xfversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \ grep '^"%%%"' 2>/dev/null | \ sed -e 's/^"%%%"\(.*\)"%%%"/\1/' -e 's/ //g'` rm -f conftest*]) +XFORMS_VERSION=$lyx_cv_xfversion case "$lyx_cv_xfversion" in "(unknown)"|0.8[1-7]*) LYX_ERROR(dnl @@ -916,7 +920,6 @@ AC_ARG_WITH(frontend, Possible values: xforms, qt2, gnome], [lyx_use_frontend="$withval"], [lyx_use_frontend="xforms"]) AC_MSG_RESULT($lyx_use_frontend) -lyx_flags="$lyx_flags frontend-$lyx_use_frontend" AC_SUBST(FRONTEND) AC_SUBST(FRONTEND_GUILIB) AC_SUBST(FRONTEND_LDFLAGS) diff --git a/configure.in b/configure.in index e9d576470f..d7fe799690 100644 --- a/configure.in +++ b/configure.in @@ -185,8 +185,7 @@ dnl The code below is not in a macro, because this would cause big dnl problems with the AC_REQUIRE contained in KDE_DO_IT_ALL. case "$lyx_use_frontend" in xforms) - # for now don't set it for xforms as this is always entered - FRONTEND="" + FRONTEND="xforms" FRONTEND_GUILIB="xforms/libxforms.la";; gnome) AM_PATH_GTKMM(1.2.1,, @@ -227,6 +226,11 @@ if test "$have_x" = yes ; then # version numbers... LYX_PATH_XPM LYX_PATH_XFORMS +FRONTEND_INFO=`cat < + + * lyx_main.C (commandLineHelp): remove version information + +2001-09-08 Rob Lahaye + + * lyx_main.C: add -version commandline option + 2001-09-09 Lars Gullik Bjønnes * paragraph.h: make the optional constructor arg required instead. diff --git a/src/lyx_main.C b/src/lyx_main.C index 6993f748a2..69c9aa8496 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -752,7 +752,6 @@ void setDebuggingLevel(string const & dbgLevel) // Give command line help void commandLineHelp() { - lyxerr << "LyX " LYX_VERSION << " of " LYX_RELEASE << endl; lyxerr << _("Usage: lyx [ command line switches ] [ name.lyx ... ]\n" "Command line switches (case sensitive):\n" @@ -770,9 +769,20 @@ void commandLineHelp() "\t-i [--import] fmt file.xxx\n" " where fmt is the import format of choice\n" " and file.xxx is the file to be imported.\n" + "\t-version summarize version and build info\n" "Check the LyX man page for more details.") << endl; } +// Give command line version information +void commandLineVersionInfo() +{ + lyxerr << "LyX " LYX_VERSION << " of " LYX_RELEASE << endl; + lyxerr << "Built on " << __DATE__ << ", " << __TIME__ << endl; + + lyxerr << VERSION_INFO << endl; +} + + } // namespace anon @@ -822,6 +832,11 @@ bool LyX::easyParse(int * argc, char * argv[]) commandLineHelp(); exit(0); } + // Check for --version or -version + else if (arg == "--version" || arg == "-version") { + commandLineVersionInfo(); + exit(0); + } // Check for "-nw": No XWindows as for emacs this should // give a LyX that could be used in a terminal window. //else if (arg == "-nw") {