update make_torrent example to support controlling tracker tiers

This commit is contained in:
arvidn 2020-02-03 02:34:45 +01:00 committed by Arvid Norberg
parent f099f356c6
commit 9344dcc9b1
1 changed files with 4 additions and 3 deletions

View File

@ -125,7 +125,8 @@ OPTIONS:
the specified url
-t url adds the specified tracker to the
torrent. For multiple trackers, specify more
-t options
-t options. Specify a dash character "-" as a tracker to indicate
the following trackers should be in a higher tier.
-c comment sets the comment to the specified string
-C creator sets the created-by field to the specified string
-p bytes enables padding files. Files larger
@ -288,8 +289,8 @@ int main(int argc_, char const* argv_[]) try
lt::create_torrent t(fs, piece_size, pad_file_limit, flags);
int tier = 0;
for (std::string const& tr : trackers) {
t.add_tracker(tr, tier);
++tier;
if (tr == "-") ++tier;
else t.add_tracker(tr, tier);
}
for (std::string const& ws : web_seeds)