Add --version command line option

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

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2015-05-20 23:07:55 +02:00
parent d271f628d8
commit 290485e8ab
1 changed files with 11 additions and 0 deletions

View File

@ -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);