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:
parent
d271f628d8
commit
290485e8ab
|
@ -671,11 +671,22 @@ int main(int argc, char *argv[]) {
|
||||||
entry3.set_description(_("Maximize the window."));
|
entry3.set_description(_("Maximize the window."));
|
||||||
group.add_entry(entry3, maximize);
|
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);
|
options.set_main_group(group);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Gtk::Main kit(argc, argv, options);
|
Gtk::Main kit(argc, argv, options);
|
||||||
|
|
||||||
|
if (version) {
|
||||||
|
printf("%s\n", PACKAGE_STRING);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
ca_context_set_driver(ca_gtk_context_get(), "pulse");
|
ca_context_set_driver(ca_gtk_context_get(), "pulse");
|
||||||
|
|
||||||
MainWindow* mainWindow = MainWindow::create(maximize);
|
MainWindow* mainWindow = MainWindow::create(maximize);
|
||||||
|
|
Loading…
Reference in New Issue