[pulseaudio-discuss] [PATCH] Add --version command line option

Peter Meerwald pmeerw at pmeerw.net
Wed May 20 14:11:12 PDT 2015


allow pavucontrol to display its --version
see https://bugs.freedesktop.org/show_bug.cgi?id=83147

Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
---
 src/pavucontrol.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc
index c1019b6..7a95c3e 100644
--- a/src/pavucontrol.cc
+++ b/src/pavucontrol.cc
@@ -671,11 +671,22 @@ int main(int argc, char *argv[]) {
     entry3.set_description(_("Maximize the window."));
     group.add_entry(entry3, maximize);
 
+    bool version = false;
+    Glib::OptionEntry entry4;
+    entry4.set_long_name("version");
+    entry4.set_description(_("Show version"));
+    group.add_entry(entry4, version);
+
     options.set_main_group(group);
 
     try {
         Gtk::Main kit(argc, argv, options);
 
+        if (version) {
+            printf("%s\n", PACKAGE_STRING);
+            return 0;
+        }
+
         ca_context_set_driver(ca_gtk_context_get(), "pulse");
 
         MainWindow* mainWindow = MainWindow::create(maximize);
-- 
1.9.1



More information about the pulseaudio-discuss mailing list