mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
* Added '-n' flag that disables loading of ~/.rtorrent.rc.
* Re-added priority change when a download finishes. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@686 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -74,6 +74,7 @@ OptionParser::process(int argc, char** argv) {
|
||||
int c;
|
||||
std::string optString = create_optstring();
|
||||
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
while ((c = getopt(argc, argv, optString.c_str())) != -1)
|
||||
@@ -85,6 +86,21 @@ OptionParser::process(int argc, char** argv) {
|
||||
return optind;
|
||||
}
|
||||
|
||||
bool
|
||||
OptionParser::has_flag(char flag, int argc, char** argv) {
|
||||
int result;
|
||||
char options[2] = { flag, '\0' };
|
||||
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
while ((result = getopt(argc, argv, options)) != -1)
|
||||
if (result == flag)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string
|
||||
OptionParser::create_optstring() {
|
||||
std::string s;
|
||||
|
||||
Reference in New Issue
Block a user