Link to tracking issues from BEP support table
type: documentation
This commit is contained in:
parent
ff3a30ae21
commit
1a20f0d0b3
44
README.md
44
README.md
|
@ -53,32 +53,32 @@ To force colored output, pass `--use-color always` on the command line.
|
|||
### BEP Support
|
||||
|
||||
| Symbol | Meaning |
|
||||
|--------------------|----------------|
|
||||
|--------------------|---------------------------------------|
|
||||
| :white_check_mark: | Supported |
|
||||
| :x: | Unsupported |
|
||||
| :x: | Unsupported (links to tracking issue) |
|
||||
| :heavy_minus_sign: | Not Applicable |
|
||||
|
||||
| BEP | Status | Title |
|
||||
|:----------------------------------------------:|:------------------:|:-----------------------------------------------------------------|
|
||||
|:----------------------------------------------:|:-----------------------------------------------------:|:-----------------------------------------------------------------|
|
||||
| [00](http://bittorrent.org/beps/bep_0000.html) | :heavy_minus_sign: | Index of BitTorrent Enhancement Proposals |
|
||||
| [01](http://bittorrent.org/beps/bep_0001.html) | :heavy_minus_sign: | The BitTorrent Enhancement Proposal Process |
|
||||
| [02](http://bittorrent.org/beps/bep_0002.html) | :heavy_minus_sign: | Sample reStructured Text BEP Template |
|
||||
| [03](http://bittorrent.org/beps/bep_0003.html) | :white_check_mark: | The BitTorrent Protocol Specification |
|
||||
| [04](http://bittorrent.org/beps/bep_0004.html) | :heavy_minus_sign: | Assigned Numbers |
|
||||
| [05](http://bittorrent.org/beps/bep_0005.html) | :x: | DHT Protocol |
|
||||
| [05](http://bittorrent.org/beps/bep_0005.html) | [:x:](https://github.com/casey/intermodal/issues/90) | DHT Protocol |
|
||||
| [06](http://bittorrent.org/beps/bep_0006.html) | :heavy_minus_sign: | Fast Extension |
|
||||
| [07](http://bittorrent.org/beps/bep_0007.html) | :heavy_minus_sign: | IPv6 Tracker Extension |
|
||||
| [08](http://bittorrent.org/beps/bep_0008.html) | :heavy_minus_sign: | Tracker Peer Obfuscation |
|
||||
| [09](http://bittorrent.org/beps/bep_0009.html) | :x: | Extension for Peers to Send Metadata Files |
|
||||
| [09](http://bittorrent.org/beps/bep_0009.html) | [:x:](https://github.com/casey/intermodal/issues/91) | Extension for Peers to Send Metadata Files |
|
||||
| [10](http://bittorrent.org/beps/bep_0010.html) | :heavy_minus_sign: | Extension Protocol |
|
||||
| [11](http://bittorrent.org/beps/bep_0011.html) | :heavy_minus_sign: | Peer Exchange (PEX) |
|
||||
| [12](http://bittorrent.org/beps/bep_0012.html) | :white_check_mark: | Multitracker Metadata Extension |
|
||||
| [14](http://bittorrent.org/beps/bep_0014.html) | :heavy_minus_sign: | Local Service Discovery |
|
||||
| [15](http://bittorrent.org/beps/bep_0015.html) | :heavy_minus_sign: | UDP Tracker Protocol for BitTorrent |
|
||||
| [16](http://bittorrent.org/beps/bep_0016.html) | :heavy_minus_sign: | Superseeding |
|
||||
| [17](http://bittorrent.org/beps/bep_0017.html) | :x: | HTTP Seeding |
|
||||
| [17](http://bittorrent.org/beps/bep_0017.html) | [:x:](https://github.com/casey/intermodal/issues/92) | HTTP Seeding |
|
||||
| [18](http://bittorrent.org/beps/bep_0018.html) | :heavy_minus_sign: | Search Engine Specificiation |
|
||||
| [19](http://bittorrent.org/beps/bep_0019.html) | :x: | WebSeed - HTTP/FTP Seeding (GetRight style) |
|
||||
| [19](http://bittorrent.org/beps/bep_0019.html) | [:x:](https://github.com/casey/intermodal/issues/93) | WebSeed - HTTP/FTP Seeding (GetRight style) |
|
||||
| [20](http://bittorrent.org/beps/bep_0020.html) | :heavy_minus_sign: | Peer ID Conventions |
|
||||
| [21](http://bittorrent.org/beps/bep_0021.html) | :heavy_minus_sign: | Extension for partial seeds |
|
||||
| [22](http://bittorrent.org/beps/bep_0022.html) | :heavy_minus_sign: | BitTorrent Local Tracker Discovery Protocol |
|
||||
|
@ -89,29 +89,29 @@ To force colored output, pass `--use-color always` on the command line.
|
|||
| [27](http://bittorrent.org/beps/bep_0027.html) | :white_check_mark: | Private Torrents |
|
||||
| [28](http://bittorrent.org/beps/bep_0028.html) | :heavy_minus_sign: | Tracker exchange extension |
|
||||
| [29](http://bittorrent.org/beps/bep_0029.html) | :heavy_minus_sign: | uTorrent transport protocol |
|
||||
| [30](http://bittorrent.org/beps/bep_0030.html) | :x: | Merkle hash torrent extension |
|
||||
| [30](http://bittorrent.org/beps/bep_0030.html) | [:x:](https://github.com/casey/intermodal/issues/94) | Merkle hash torrent extension |
|
||||
| [31](http://bittorrent.org/beps/bep_0031.html) | :heavy_minus_sign: | Failure Retry Extension |
|
||||
| [32](http://bittorrent.org/beps/bep_0032.html) | :heavy_minus_sign: | BitTorrent DHT Extensions for IPv6 |
|
||||
| [33](http://bittorrent.org/beps/bep_0033.html) | :heavy_minus_sign: | DHT Scrapes |
|
||||
| [34](http://bittorrent.org/beps/bep_0034.html) | :x: | DNS Tracker Preferences |
|
||||
| [35](http://bittorrent.org/beps/bep_0035.html) | :x: | Torrent Signing |
|
||||
| [36](http://bittorrent.org/beps/bep_0036.html) | :x: | Torrent RSS feeds |
|
||||
| [34](http://bittorrent.org/beps/bep_0034.html) | :heavy_minus_sign: | DNS Tracker Preferences |
|
||||
| [35](http://bittorrent.org/beps/bep_0035.html) | [:x:](https://github.com/casey/intermodal/issues/96) | Torrent Signing |
|
||||
| [36](http://bittorrent.org/beps/bep_0036.html) | :heavy_minus_sign: | Torrent RSS feeds |
|
||||
| [37](http://bittorrent.org/beps/bep_0037.html) | :heavy_minus_sign: | Anonymous BitTorrent over proxies |
|
||||
| [38](http://bittorrent.org/beps/bep_0038.html) | :x: | Finding Local Data Via Torrent File Hints |
|
||||
| [39](http://bittorrent.org/beps/bep_0039.html) | :x: | Updating Torrents Via Feed URL |
|
||||
| [38](http://bittorrent.org/beps/bep_0038.html) | :heavy_minus_sign: | Finding Local Data Via Torrent File Hints |
|
||||
| [39](http://bittorrent.org/beps/bep_0039.html) | [:x:](https://github.com/casey/intermodal/issues/98) | Updating Torrents Via Feed URL |
|
||||
| [40](http://bittorrent.org/beps/bep_0040.html) | :heavy_minus_sign: | Canonical Peer Priority |
|
||||
| [41](http://bittorrent.org/beps/bep_0041.html) | :x: | UDP Tracker Protocol Extensions |
|
||||
| [41](http://bittorrent.org/beps/bep_0041.html) | [:x:](https://github.com/casey/intermodal/issues/97) | UDP Tracker Protocol Extensions |
|
||||
| [42](http://bittorrent.org/beps/bep_0042.html) | :heavy_minus_sign: | DHT Security extension |
|
||||
| [43](http://bittorrent.org/beps/bep_0043.html) | :heavy_minus_sign: | Read-only DHT Nodes |
|
||||
| [44](http://bittorrent.org/beps/bep_0044.html) | :x: | Storing arbitrary data in the DHT |
|
||||
| [45](http://bittorrent.org/beps/bep_0045.html) | :x: | Multiple-address operation for the BitTorrent DHT |
|
||||
| [46](http://bittorrent.org/beps/bep_0046.html) | :x: | Updating Torrents Via DHT Mutable Items |
|
||||
| [47](http://bittorrent.org/beps/bep_0047.html) | :x: | Padding files and extended file attributes |
|
||||
| [48](http://bittorrent.org/beps/bep_0048.html) | :x: | Tracker Protocol Extension: Scrape |
|
||||
| [49](http://bittorrent.org/beps/bep_0049.html) | :x: | Distributed Torrent Feeds |
|
||||
| [44](http://bittorrent.org/beps/bep_0044.html) | :heavy_minus_sign: | Storing arbitrary data in the DHT |
|
||||
| [45](http://bittorrent.org/beps/bep_0045.html) | :heavy_minus_sign: | Multiple-address operation for the BitTorrent DHT |
|
||||
| [46](http://bittorrent.org/beps/bep_0046.html) | :heavy_minus_sign: | Updating Torrents Via DHT Mutable Items |
|
||||
| [47](http://bittorrent.org/beps/bep_0047.html) | [:x:](https://github.com/casey/intermodal/issues/99) | Padding files and extended file attributes |
|
||||
| [48](http://bittorrent.org/beps/bep_0048.html) | :heavy_minus_sign: | Tracker Protocol Extension: Scrape |
|
||||
| [49](http://bittorrent.org/beps/bep_0049.html) | [:x:](https://github.com/casey/intermodal/issues/100) | Distributed Torrent Feeds |
|
||||
| [50](http://bittorrent.org/beps/bep_0050.html) | :heavy_minus_sign: | Publish/Subscribe Protocol |
|
||||
| [51](http://bittorrent.org/beps/bep_0051.html) | :heavy_minus_sign: | DHT Infohash Indexing |
|
||||
| [52](http://bittorrent.org/beps/bep_0052.html) | :x: | The BitTorrent Protocol Specification v2 |
|
||||
| [53](http://bittorrent.org/beps/bep_0053.html) | :x: | Magnet URI extension - Select specific file indices for download |
|
||||
| [52](http://bittorrent.org/beps/bep_0052.html) | [:x:](https://github.com/casey/intermodal/issues/101) | The BitTorrent Protocol Specification v2 |
|
||||
| [53](http://bittorrent.org/beps/bep_0053.html) | :heavy_minus_sign: | Magnet URI extension - Select specific file indices for download |
|
||||
| [54](http://bittorrent.org/beps/bep_0054.html) | :heavy_minus_sign: | The lt_donthave extension |
|
||||
| [55](http://bittorrent.org/beps/bep_0055.html) | :heavy_minus_sign: | Holepunch extension |
|
||||
|
|
|
@ -149,31 +149,62 @@ impl Opt {
|
|||
|
||||
assert_eq!(originals.len(), beps.len());
|
||||
|
||||
let mut lines = Vec::new();
|
||||
let mut width = (0, 0, 0);
|
||||
|
||||
let width = beps.iter().map(|bep| bep.title.len()).max().unwrap_or(0);
|
||||
|
||||
lines.push(format!(
|
||||
"| BEP | Status | {:width$} |",
|
||||
"Title",
|
||||
width = width
|
||||
));
|
||||
|
||||
lines.push(format!(
|
||||
"|:----------------------------------------------:|:------------------:|:{:-<width$}-|",
|
||||
"",
|
||||
width = width
|
||||
));
|
||||
|
||||
for (bep, original) in beps.into_iter().zip(originals) {
|
||||
let rows = beps
|
||||
.into_iter()
|
||||
.zip(originals)
|
||||
.map(|(bep, original)| {
|
||||
assert_eq!(bep.number, original.number);
|
||||
lines.push(format!(
|
||||
"| [{:02}](http://bittorrent.org/beps/bep_{:04}.html) | {:18} | {:width$} |",
|
||||
bep.number,
|
||||
bep.number,
|
||||
|
||||
let row = (
|
||||
format!(
|
||||
"[{:02}](http://bittorrent.org/beps/bep_{:04}.html)",
|
||||
bep.number, bep.number
|
||||
),
|
||||
original.status.to_string(),
|
||||
bep.title,
|
||||
width = width
|
||||
);
|
||||
|
||||
width.0 = width.0.max(row.0.len());
|
||||
width.1 = width.1.max(row.1.len());
|
||||
width.2 = width.2.max(row.2.len());
|
||||
|
||||
row
|
||||
})
|
||||
.collect::<Vec<(String, String, String)>>();
|
||||
|
||||
let mut lines = Vec::new();
|
||||
|
||||
lines.push(format!(
|
||||
"| {:w0$} | {:w1$} | {:w2$} |",
|
||||
"BEP",
|
||||
"Status",
|
||||
"Title",
|
||||
w0 = width.0,
|
||||
w1 = width.1,
|
||||
w2 = width.2,
|
||||
));
|
||||
|
||||
lines.push(format!(
|
||||
"|:{:-<w0$}:|:{:-<w1$}:|:{:-<w2$}-|",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
w0 = width.0,
|
||||
w1 = width.1,
|
||||
w2 = width.2,
|
||||
));
|
||||
|
||||
for (bep, status, title) in rows {
|
||||
lines.push(format!(
|
||||
"| {:w0$} | {:w1$} | {:w2$} |",
|
||||
bep,
|
||||
status,
|
||||
title,
|
||||
w0 = width.0,
|
||||
w1 = width.1,
|
||||
w2 = width.2,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -4,23 +4,55 @@ pub(crate) enum Status {
|
|||
Unknown,
|
||||
NotApplicable,
|
||||
Supported,
|
||||
NotSupported,
|
||||
NotSupported { tracking_issue: Option<u64> },
|
||||
}
|
||||
|
||||
impl FromStr for Status {
|
||||
type Err = String;
|
||||
|
||||
fn from_str(text: &str) -> Result<Self, Self::Err> {
|
||||
match text.replace('\\', "").as_str() {
|
||||
"x" => Ok(Self::NotSupported),
|
||||
"+" => Ok(Self::Supported),
|
||||
"-" => Ok(Self::NotApplicable),
|
||||
"?" => Ok(Self::Unknown),
|
||||
":x:" => Ok(Self::NotSupported),
|
||||
":white_check_mark:" => Ok(Self::Supported),
|
||||
":heavy_minus_sign:" => Ok(Self::NotApplicable),
|
||||
":grey_question:" => Ok(Self::Unknown),
|
||||
_ => Err(format!("invalid status: {}", text)),
|
||||
let error = || format!("invalid status: {}", text);
|
||||
|
||||
let unescaped = text.replace('\\', "");
|
||||
|
||||
let (emoji, tracking_issue) = if !unescaped.starts_with('[') {
|
||||
(text, None)
|
||||
} else {
|
||||
let status_pattern = Regex::new(
|
||||
r"(?x)
|
||||
^
|
||||
\[
|
||||
(?P<emoji>:[a-zA-Z0-9]+:)
|
||||
\]
|
||||
\(
|
||||
https://github.com/casey/intermodal/issues/(?P<tracking_issue>[0-9]+)
|
||||
\)
|
||||
$
|
||||
",
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let captures = status_pattern.captures(&unescaped).ok_or_else(error)?;
|
||||
|
||||
let emoji = captures.name("emoji").unwrap().as_str();
|
||||
|
||||
let tracking_issue = captures
|
||||
.name("tracking_issue")
|
||||
.map(|text| text.as_str().parse::<u64>().unwrap());
|
||||
|
||||
(emoji, tracking_issue)
|
||||
};
|
||||
|
||||
match emoji {
|
||||
"x" => Ok(Status::NotSupported { tracking_issue }),
|
||||
"+" => Ok(Status::Supported),
|
||||
"-" => Ok(Status::NotApplicable),
|
||||
"?" => Ok(Status::Unknown),
|
||||
":x:" => Ok(Status::NotSupported { tracking_issue }),
|
||||
":white_check_mark:" => Ok(Status::Supported),
|
||||
":heavy_minus_sign:" => Ok(Status::NotApplicable),
|
||||
":grey_question:" => Ok(Status::Unknown),
|
||||
_ => Err(error()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +63,16 @@ impl Display for Status {
|
|||
Self::Unknown => write!(f, ":grey_question:"),
|
||||
Self::NotApplicable => write!(f, ":heavy_minus_sign:"),
|
||||
Self::Supported => write!(f, ":white_check_mark:"),
|
||||
Self::NotSupported => write!(f, ":x:"),
|
||||
Self::NotSupported {
|
||||
tracking_issue: None,
|
||||
} => write!(f, ":x:"),
|
||||
Self::NotSupported {
|
||||
tracking_issue: Some(number),
|
||||
} => write!(
|
||||
f,
|
||||
"[:x:](https://github.com/casey/intermodal/issues/{})",
|
||||
number
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user