Bug 105233 - JJ: kdeinit -v does not provide version information
Summary: JJ: kdeinit -v does not provide version information
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeinit (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-07 11:53 UTC by Michael Prokop
Modified: 2008-10-31 17:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Prokop 2005-05-07 11:53:23 UTC
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
Comment 1 Stephan Binner 2005-05-07 16:16:15 UTC
Why should kdeinit do that? Why should it print the window manager version!?

Do you know "kde-config --version"?
Comment 2 Michael Prokop 2005-05-07 16:23:55 UTC
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
% ...
Comment 3 Jaime Torres 2008-09-30 13:07:28 UTC
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)

Comment 4 Allen Winter 2008-10-01 23:29:20 UTC
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()
Comment 5 David Faure 2008-10-02 13:18:46 UTC
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.

Comment 6 Allen Winter 2008-10-02 14:42:41 UTC
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.
Comment 7 Jaime Torres 2008-10-31 17:35:19 UTC
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