fixes the year for fluxbox -version

added a way to display the svn-revision-number in fluxbox -info
This commit is contained in:
mathias 2005-02-03 16:46:46 +00:00
parent a88dcb3676
commit b7bf873aa0
2 changed files with 15 additions and 3 deletions

View file

@ -41,11 +41,20 @@ defaults.hh: Makefile
echo '#define DEFAULTKEYSFILE "$(DEFAULT_KEYSFILE)"' >> defaults.hh
echo '#define DEFAULT_INITFILE "$(pkgdatadir)/init"' >> defaults.hh
echo '#define LOCALEPATH "$(pkgdatadir)/nls"' >> defaults.hh
echo 'const char* svnversion(void);' >> defaults.hh
defaults.cc: force
echo 'const char* svnversion(void) {' > defaults.cc
echo ' return "'`(svnversion . | sed "s/[^0-9].*//") 2> /dev/null`'";' >> defaults.cc
echo '}' >> defaults.cc
force: ;
# an extra dep for fluxbox
fluxbox.$(OBJEXT): defaults.hh
if NEWWMSPEC
newwmspec_SOURCE= Ewmh.hh Ewmh.cc
endif
@ -120,4 +129,4 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \
${REMEMBER_SOURCE} ${REGEXP_SOURCE} ${TOOLBAR_SOURCE}
LDADD=FbTk/libFbTk.a
LDADD=FbTk/libFbTk.a defaults.$(OBJEXT)

View file

@ -63,6 +63,9 @@ using namespace std;
void showInfo(ostream &ostr) {
_FB_USES_NLS;
ostr<<_FBTEXT(Common, FluxboxVersion, "Fluxbox version", "Fluxbox version heading")<<": "<<__fluxbox_version<<endl;
if (strlen(svnversion()) > 0)
ostr<<"SVN Revision: "<<svnversion()<<endl;
#if defined(__DATE__) && defined(__TIME__)
ostr<<_FBTEXT(Common, Compiled, "Compiled", "Time fluxbox was compiled")<<": "<<__DATE__<<" "<<__TIME__<<endl;
#endif
@ -221,7 +224,7 @@ int main(int argc, char **argv) {
"\t-help\t\t\t\tdisplay this help text and exit.\n\n",
"Main usage string. Please lay it out nicely. There is one %s that is given the version"),
__fluxbox_version, "2001-2004");
__fluxbox_version, "2001-2005");
exit(0);
} else if (strcmp(argv[i], "-info") == 0 || strcmp(argv[i], "-i") == 0) {
showInfo(cout);