From 938d7f8a7e57d5b44c6c6baa497c7c66246350a1 Mon Sep 17 00:00:00 2001 From: cdfrey Date: Fri, 18 May 2007 00:24:08 +0000 Subject: [PATCH] - changed the default for debug output to "off" and added a command line option to turn it on if necessary (--debug-output) - command line option --help now also works --- gui/src/main.cc | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/gui/src/main.cc b/gui/src/main.cc index cb166f4a..ff93c9c5 100644 --- a/gui/src/main.cc +++ b/gui/src/main.cc @@ -78,11 +78,32 @@ int main(int argc, char *argv[]) old_unexpected_handler = std::set_unexpected(&unexpected_handler); old_terminate_handler = std::set_terminate(&terminate_handler); - Barry::Init(true); Glib::thread_init(); - Gtk::Main app(argc, argv); + + using namespace Glib; + OptionEntry debug_opt; + debug_opt.set_flags( + OptionEntry::FLAG_NO_ARG | + OptionEntry::FLAG_IN_MAIN | + OptionEntry::FLAG_OPTIONAL_ARG); + debug_opt.set_short_name('d'); + debug_opt.set_long_name("debug-output"); + debug_opt.set_description("Enable protocol debug output to stdout/stderr"); + + OptionGroup option_group("barry", + "Options specific to the Barry Backup application.", + "Options specific to the Barry Backup application."); + bool debug_flag = false; + option_group.add_entry(debug_opt, debug_flag); + + OptionContext option_context("Backup program for the Blackberry Handheld"); + option_context.add_group(option_group); + + Gtk::Main app(argc, argv, option_context); Glib::add_exception_handler( sigc::ptr_fun(main_exception_handler) ); + Barry::Init(debug_flag); + try { Glib::RefPtr refXml = LoadXml("BackupWindow.glade"); -- 2.11.4.GIT