04338e3501
Merge documentation generation into a single binary, `bin/gen`. This includes: The changelog, man pages, the readme, and the book. type: reform
199 lines
17 KiB
Plaintext
199 lines
17 KiB
Plaintext
edit:completion:arg-completer[imdl] = [@words]{
|
|
fn spaces [n]{
|
|
repeat $n ' ' | joins ''
|
|
}
|
|
fn cand [text desc]{
|
|
edit:complex-candidate $text &display-suffix=' '(spaces (- 14 (wcswidth $text)))$desc
|
|
}
|
|
command = 'imdl'
|
|
for word $words[1:-1] {
|
|
if (has-prefix $word '-') {
|
|
break
|
|
}
|
|
command = $command';'$word
|
|
}
|
|
completions = [
|
|
&'imdl'= {
|
|
cand --color 'Print colorful output according to `WHEN`. When `auto`, the default, colored output is only enabled if imdl detects that it is connected to a terminal, the `NO_COLOR` environment variable is not set, and the `TERM` environment variable is not set to `dumb`.'
|
|
cand -u 'Enable unstable features. To avoid premature stabilization and excessive version churn, unstable features are unavailable unless this flag is set. Unstable features are not bound by semantic versioning stability guarantees, and may be changed or removed at any time.'
|
|
cand --unstable 'Enable unstable features. To avoid premature stabilization and excessive version churn, unstable features are unavailable unless this flag is set. Unstable features are not bound by semantic versioning stability guarantees, and may be changed or removed at any time.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
cand torrent 'Subcommands related to the BitTorrent protocol.'
|
|
cand completions 'Print shell completion scripts to standard output.'
|
|
cand help 'Prints this message or the help of the given subcommand(s)'
|
|
}
|
|
&'imdl;torrent'= {
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
cand create 'Create a .torrent file.'
|
|
cand link 'Generate a magnet link from a .torrent file.'
|
|
cand piece-length 'Display information about automatic piece length selection.'
|
|
cand show 'Display information about a .torrent file.'
|
|
cand stats 'Show statistics about a collection of .torrent files.'
|
|
cand verify 'Verify files against a .torrent file.'
|
|
cand help 'Prints this message or the help of the given subcommand(s)'
|
|
}
|
|
&'imdl;torrent;create'= {
|
|
cand -a 'Use `URL` as the primary tracker announce URL. To supply multiple announce URLs, also use `--announce-tier`.'
|
|
cand --announce 'Use `URL` as the primary tracker announce URL. To supply multiple announce URLs, also use `--announce-tier`.'
|
|
cand -A 'Allow `LINT`. Lints check for conditions which, although permitted, are not usually desirable. For example, piece length can be any non-zero value, but probably shouldn''t be below 16 KiB. The lint `small-piece-size` checks for this, and `--allow small-piece-size` can be used to disable this check.'
|
|
cand --allow 'Allow `LINT`. Lints check for conditions which, although permitted, are not usually desirable. For example, piece length can be any non-zero value, but probably shouldn''t be below 16 KiB. The lint `small-piece-size` checks for this, and `--allow small-piece-size` can be used to disable this check.'
|
|
cand -t 'Use `URL-LIST` as a tracker announce tier. Each instance adds a new tier. To add multiple trackers to a given tier, separate their announce URLs with commas:
|
|
|
|
`--announce-tier udp://example.com:80/announce,https://example.net:443/announce`
|
|
|
|
Announce tiers are stored in the `announce-list` key of the top-level metainfo dictionary as a list of lists of strings, as defined by BEP 12: Multitracker Metadata Extension.
|
|
|
|
Note: Many BitTorrent clients do not implement the behavior described in BEP 12. See the discussion here for more details: https://github.com/bittorrent/bittorrent.org/issues/82'
|
|
cand --announce-tier 'Use `URL-LIST` as a tracker announce tier. Each instance adds a new tier. To add multiple trackers to a given tier, separate their announce URLs with commas:
|
|
|
|
`--announce-tier udp://example.com:80/announce,https://example.net:443/announce`
|
|
|
|
Announce tiers are stored in the `announce-list` key of the top-level metainfo dictionary as a list of lists of strings, as defined by BEP 12: Multitracker Metadata Extension.
|
|
|
|
Note: Many BitTorrent clients do not implement the behavior described in BEP 12. See the discussion here for more details: https://github.com/bittorrent/bittorrent.org/issues/82'
|
|
cand -c 'Include `TEXT` as the comment for generated `.torrent` file. Stored under `comment` key of top-level metainfo dictionary.'
|
|
cand --comment 'Include `TEXT` as the comment for generated `.torrent` file. Stored under `comment` key of top-level metainfo dictionary.'
|
|
cand --node 'Add DHT bootstrap node `NODE` to torrent. `NODE` should be in the form `HOST:PORT`, where `HOST` is a domain name, an IPv4 address, or an IPv6 address surrounded by brackets. May be given more than once to add multiple bootstrap nodes.
|
|
|
|
Examples:
|
|
|
|
--node router.example.com:1337
|
|
|
|
--node 203.0.113.0:2290
|
|
|
|
--node [2001:db8:4275:7920:6269:7463:6f69:6e21]:8832'
|
|
cand -g 'Include or exclude files that match `GLOB`. Multiple glob may be provided, with the last one taking precedence. Precede a glob with `!` to exclude it.'
|
|
cand --glob 'Include or exclude files that match `GLOB`. Multiple glob may be provided, with the last one taking precedence. Precede a glob with `!` to exclude it.'
|
|
cand -i 'Read torrent contents from `PATH`. If `PATH` is a file, torrent will be a single-file torrent. If `PATH` is a directory, torrent will be a multi-file torrent. If `PATH` is `-`, read from standard input. Piece length defaults to 256KiB when reading from standard input if `--piece-length` is not given.'
|
|
cand --input 'Read torrent contents from `PATH`. If `PATH` is a file, torrent will be a single-file torrent. If `PATH` is a directory, torrent will be a multi-file torrent. If `PATH` is `-`, read from standard input. Piece length defaults to 256KiB when reading from standard input if `--piece-length` is not given.'
|
|
cand -N 'Set name of torrent to `TEXT`. Defaults to the filename of the argument to `--input`. Required when `--input -`.'
|
|
cand --name 'Set name of torrent to `TEXT`. Defaults to the filename of the argument to `--input`. Required when `--input -`.'
|
|
cand --sort-by 'Set the order of files within a torrent. `SPEC` should be of the form `KEY:ORDER`, with `KEY` being one of `path` or `size`, and `ORDER` being `ascending` or `descending`. `:ORDER` defaults to `ascending` if omitted. The `--sort-by` flag may be given more than once, with later values being used to break ties. Ties that remain are broken in ascending path order.
|
|
|
|
Sort in ascending order by path, the default:
|
|
|
|
--sort-by path:ascending
|
|
|
|
Sort in ascending order by path, more concisely:
|
|
|
|
--sort-by path
|
|
|
|
Sort in ascending order by size, break ties in descending path order:
|
|
|
|
--sort-by size:ascending --sort-by path:descending'
|
|
cand -o 'Save `.torrent` file to `TARGET`, or print to standard output if `TARGET` is `-`. Defaults to the argument to `--input` with an `.torrent` extension appended. Required when `--input -`.'
|
|
cand --output 'Save `.torrent` file to `TARGET`, or print to standard output if `TARGET` is `-`. Defaults to the argument to `--input` with an `.torrent` extension appended. Required when `--input -`.'
|
|
cand --peer 'Add `PEER` to magnet link.'
|
|
cand -p 'Set piece length to `BYTES`. Accepts SI units, e.g. kib, mib, and gib.'
|
|
cand --piece-length 'Set piece length to `BYTES`. Accepts SI units, e.g. kib, mib, and gib.'
|
|
cand -s 'Set torrent source to `TEXT`. Stored under `source` key of info dictionary. This is useful for keeping statistics from being mis-reported when participating in swarms with the same contents, but with different trackers. When source is set to a unique value for torrents with the same contents, torrent clients will treat them as distinct torrents, and not share peers between them, and will correctly report download and upload statistics to multiple trackers.'
|
|
cand --source 'Set torrent source to `TEXT`. Stored under `source` key of info dictionary. This is useful for keeping statistics from being mis-reported when participating in swarms with the same contents, but with different trackers. When source is set to a unique value for torrents with the same contents, torrent clients will treat them as distinct torrents, and not share peers between them, and will correctly report download and upload statistics to multiple trackers.'
|
|
cand -n 'Skip writing `.torrent` file to disk.'
|
|
cand --dry-run 'Skip writing `.torrent` file to disk.'
|
|
cand -F 'Follow symlinks in torrent input. By default, symlinks to files and directories are not included in torrent contents.'
|
|
cand --follow-symlinks 'Follow symlinks in torrent input. By default, symlinks to files and directories are not included in torrent contents.'
|
|
cand -f 'Overwrite the destination `.torrent` file, if it exists.'
|
|
cand --force 'Overwrite the destination `.torrent` file, if it exists.'
|
|
cand -h 'Include hidden files that would otherwise be skipped, such as files that start with a `.`, and files hidden by file attributes on macOS and Windows.'
|
|
cand --include-hidden 'Include hidden files that would otherwise be skipped, such as files that start with a `.`, and files hidden by file attributes on macOS and Windows.'
|
|
cand -j 'Include junk files that would otherwise be skipped.'
|
|
cand --include-junk 'Include junk files that would otherwise be skipped.'
|
|
cand --link 'Print created torrent `magnet:` URL to standard output'
|
|
cand -M 'Include MD5 checksum of each file in the torrent. N.B. MD5 is cryptographically broken and only suitable for checking for accidental corruption.'
|
|
cand --md5 'Include MD5 checksum of each file in the torrent. N.B. MD5 is cryptographically broken and only suitable for checking for accidental corruption.'
|
|
cand --no-created-by 'Do not populate `created by` key of generated torrent with imdl version information.'
|
|
cand --no-creation-date 'Do not populate `creation date` key of generated torrent with current time.'
|
|
cand -O 'Open `.torrent` file after creation. Uses `xdg-open`, `gnome-open`, or `kde-open` on Linux; `open` on macOS; and `cmd /C start` on Windows'
|
|
cand --open 'Open `.torrent` file after creation. Uses `xdg-open`, `gnome-open`, or `kde-open` on Linux; `open` on macOS; and `cmd /C start` on Windows'
|
|
cand -P 'Set the `private` flag. Torrent clients that understand the flag and participate in the swarm of a torrent with the flag set will only announce themselves to the announce URLs included in the torrent, and will not use other peer discovery mechanisms, such as the DHT or local peer discovery. See BEP 27: Private Torrents for more information.'
|
|
cand --private 'Set the `private` flag. Torrent clients that understand the flag and participate in the swarm of a torrent with the flag set will only announce themselves to the announce URLs included in the torrent, and will not use other peer discovery mechanisms, such as the DHT or local peer discovery. See BEP 27: Private Torrents for more information.'
|
|
cand -S 'Display information about created torrent file.'
|
|
cand --show 'Display information about created torrent file.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;link'= {
|
|
cand -i 'Generate magnet link from metainfo at `PATH`. If `PATH` is `-`, read metainfo from standard input.'
|
|
cand --input 'Generate magnet link from metainfo at `PATH`. If `PATH` is `-`, read metainfo from standard input.'
|
|
cand -p 'Add `PEER` to magnet link.'
|
|
cand --peer 'Add `PEER` to magnet link.'
|
|
cand -s 'Select files to download. Values are indices into the `info.files` list, e.g. `--select-only 1,2,3`.'
|
|
cand --select-only 'Select files to download. Values are indices into the `info.files` list, e.g. `--select-only 1,2,3`.'
|
|
cand -O 'Open generated magnet link. Uses `xdg-open`, `gnome-open`, or `kde-open` on Linux; `open` on macOS; and `cmd /C start` on Windows.'
|
|
cand --open 'Open generated magnet link. Uses `xdg-open`, `gnome-open`, or `kde-open` on Linux; `open` on macOS; and `cmd /C start` on Windows.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;piece-length'= {
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;show'= {
|
|
cand -i 'Show information about torrent at `PATH`. If `Path` is `-`, read torrent metainfo from standard input.'
|
|
cand --input 'Show information about torrent at `PATH`. If `Path` is `-`, read torrent metainfo from standard input.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;stats'= {
|
|
cand -l 'Stop after processing `N` torrents. Useful when processing large collections of `.torrent` files.'
|
|
cand --limit 'Stop after processing `N` torrents. Useful when processing large collections of `.torrent` files.'
|
|
cand -e 'Extract and display values under key paths that match `REGEX`. Subkeys of a bencodeded dictionary are delimited by `/`, and values of a bencoded list are delmited by `*`. For example, given the following bencoded dictionary `{"foo": [{"bar": {"baz": 2}}]}`, the value `2`''s key path will be `foo*bar/baz`. The value `2` would be displayed if any of `bar`, `foo[*]bar/baz`, or `foo.*baz` were passed to `--extract-pattern.'
|
|
cand --extract-pattern 'Extract and display values under key paths that match `REGEX`. Subkeys of a bencodeded dictionary are delimited by `/`, and values of a bencoded list are delmited by `*`. For example, given the following bencoded dictionary `{"foo": [{"bar": {"baz": 2}}]}`, the value `2`''s key path will be `foo*bar/baz`. The value `2` would be displayed if any of `bar`, `foo[*]bar/baz`, or `foo.*baz` were passed to `--extract-pattern.'
|
|
cand -i 'Search `PATH` for torrents. May be a directory or a single torrent file.'
|
|
cand --input 'Search `PATH` for torrents. May be a directory or a single torrent file.'
|
|
cand -p 'Pretty print the contents of each torrent as it is processed.'
|
|
cand --print 'Pretty print the contents of each torrent as it is processed.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;verify'= {
|
|
cand -i 'Verify torrent contents against torrent metainfo in `METAINFO`. If `METAINFO` is `-`, read metainfo from standard input.'
|
|
cand --input 'Verify torrent contents against torrent metainfo in `METAINFO`. If `METAINFO` is `-`, read metainfo from standard input.'
|
|
cand -c 'Verify torrent content at `PATH` against torrent metainfo. Defaults to `name` field of torrent info dictionary.'
|
|
cand --content 'Verify torrent content at `PATH` against torrent metainfo. Defaults to `name` field of torrent info dictionary.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;torrent;help'= {
|
|
cand -h 'Prints help information'
|
|
cand --help 'Prints help information'
|
|
cand -V 'Prints version information'
|
|
cand --version 'Prints version information'
|
|
}
|
|
&'imdl;completions'= {
|
|
cand -s 'Print completion script for `SHELL`.'
|
|
cand --shell 'Print completion script for `SHELL`.'
|
|
cand -d 'Write completion script to `DIR` with an appropriate filename. If `--shell` is not given, write all completion scripts.'
|
|
cand --dir 'Write completion script to `DIR` with an appropriate filename. If `--shell` is not given, write all completion scripts.'
|
|
cand -h 'Print help message.'
|
|
cand --help 'Print help message.'
|
|
cand -V 'Print version number.'
|
|
cand --version 'Print version number.'
|
|
}
|
|
&'imdl;help'= {
|
|
cand -h 'Prints help information'
|
|
cand --help 'Prints help information'
|
|
cand -V 'Prints version information'
|
|
cand --version 'Prints version information'
|
|
}
|
|
]
|
|
$completions[$command]
|
|
}
|