Version: (using KDE KDE 3.4.0) Installed from: Unlisted Binary Package OS: Linux Neither % kdeinit --version nor % kdeinit -v provide information about Qt/KDE/kdeinit version. I expected to get output like: % kwin -v Qt: 3.3.4 KDE: 3.4.0 KWin: 3.0
Why should kdeinit do that? Why should it print the window manager version!? Do you know "kde-config --version"?
Just because of consistency IMHO, YMMV. It works for most binaries: % kdepasswd -v Qt: 3.3.4 KDE: 3.3.2 KDE passwd: 3.3.2 % akregator -v Qt: 3.3.4 KDE: 3.3.2 Akregator: 1.0 beta10 % kde-menu -v Qt: 3.3.4 KDE: 3.3.2 kde-menu: 1.0 % kwin -v Qt: 3.3.4 KDE: 3.3.2 KWin: 3.0 % kdesktop -v Qt: 3.3.4 KDE: 3.3.2 KDesktop: 3.3.2 % ...
Are the following patches enought?, or are them supposed to use kcmdlineargs? --- kinit.cpp 2008-09-30 10:23:58.000000000 +0200 +++ kinit.cpp 2008-09-30 12:39:52.000000000 +0200 @@ -1742,6 +1742,16 @@ d.suicide = true; if (strcmp(safe_argv[i], "--exit") == 0) keep_running = 0; + if (strcmp(safe_argv[i], "--version") == 0) + { +#define PROGRAM_NAME "kdeinit4" +#define PROGRAM_VERSION "4.1.2" + + printf("Qt: %s\n",qVersion()); + printf("KDE: %s\n", KDE_VERSION_STRING); + printf("%s: %s\n",PROGRAM_NAME,PROGRAM_VERSION); + exit(0); + } if (strcmp(safe_argv[i], "--help") == 0) { printf("Usage: kdeinit4 [options]\n"); @@ -1755,6 +1765,7 @@ printf(" --no-kded Do not start kded\n"); printf(" --suicide Terminate when no KDE applications are left running\n"); // printf(" --exit Terminate when kded has run\n"); + printf(" --version Show version information\n"); exit(0); } } --- kinit_win.cpp 2008-09-30 12:52:52.000000000 +0200 +++ kinit_win.cpp 2008-09-30 12:55:45.000000000 +0200 @@ -337,6 +337,16 @@ #endif if (strcmp(safe_argv[i], "--verbose") == 0) verbose = 1; + if (strcmp(safe_argv[i], "--version") == 0) + { +#define PROGRAM_NAME "kdeinit4" +#define PROGRAM_VERSION "4.1.2" + + printf("Qt: %s\n",qVersion()); + printf("KDE: %s\n", KDE_VERSION_STRING); + printf("%s: %s\n",PROGRAM_NAME,PROGRAM_VERSION); + exit(0); + } if (strcmp(safe_argv[i], "--help") == 0) { printf("Usage: kdeinit4 [options]\n"); @@ -357,6 +367,7 @@ #endif printf(" --terminate hard kill of *all* running kde processes\n"); printf(" --verbose print verbose messages\n"); + printf(" --version Show version information\n"); exit(0); } if (strcmp(safe_argv[i], "--list") == 0)
no idea why kcmdlineargs isn't used by kdeinit I wonder if it would be better to get the version string from kdeversion.h?? i.e. set PROGRAM_VERSION from version_Release()
KCmdLineArgs isn't used because kdeinit is special, too low-level for being a KApplication. KDE_VERSION already comes from kdeversion.h I would just remove the line about kdeinit's own version -- it's a core part of kde[libs], it should always have the same revision as kde[libs], i.e. kdeversion.h, anyway.
Jaime, While you're at it.. maybe you'd like to write some documentation for kdeinit? At least a man page, maybe? See kdelibs/doc/kbuildsycoca4 for an example of writing a man page. I can give you help and advice if you take on this challenge.
SVN commit 878237 by jtamate: BUG: 105233 Some commands missing the --version option now have it. M +7 -0 kinit/kinit.cpp M +7 -0 kinit/kinit_win.cpp M +9 -2 kjs/kjs.cpp M +9 -0 kjsembed/kjscmd/kjscmd.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=878237