mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-15 22:52:31 +00:00
Added option and flag parseing, now supports -p for port range.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@287 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+9
-2
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "timer.h"
|
||||
#include "signal_handler.h"
|
||||
#include "option_parser.h"
|
||||
|
||||
int64_t Timer::m_cache;
|
||||
|
||||
@@ -101,6 +102,12 @@ main(int argc, char** argv) {
|
||||
SignalHandler::set_handler(SIGSEGV, sigc::bind(sigc::ptr_fun(&do_panic), SIGSEGV));
|
||||
SignalHandler::set_handler(SIGBUS, sigc::bind(sigc::ptr_fun(&do_panic), SIGBUS));
|
||||
|
||||
OptionParser optionParser;
|
||||
optionParser.insert_option('p', sigc::bind(sigc::ptr_fun(OptionParser::call_int_pair),
|
||||
sigc::mem_fun(uiControl.get_core(), &core::Manager::set_port_range)));
|
||||
|
||||
int firstArg = optionParser.process(argc, argv);
|
||||
|
||||
display::Canvas::init();
|
||||
|
||||
ui::DownloadList uiDownloadList(&uiControl);
|
||||
@@ -120,8 +127,8 @@ main(int argc, char** argv) {
|
||||
|
||||
uiControl.get_core().initialize();
|
||||
|
||||
for (int i = 1; i < argc; ++i)
|
||||
uiControl.get_core().insert(argv[i]);
|
||||
while (firstArg < argc)
|
||||
uiControl.get_core().insert(argv[firstArg++]);
|
||||
|
||||
uiControl.get_display().adjust_layout();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user