Skip to content

Commit

Permalink
Fix Z Shell completions
Browse files Browse the repository at this point in the history
The clap-generated zsh completion scripts use unescaped double-quoted
strings for the subocommand description text, which causes backtick
characters to be evaluated.

Remove backticks from the subcommand descriptions, to un-break the zsh
completion scripts.

type: fixed
pr: #365
  • Loading branch information
casey committed Apr 11, 2020
1 parent f058072 commit 727d5c1
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 46 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog

UNRELEASED - 2020-04-11
-----------------------
- :books: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Render command help text in book to avoid wrapping ([#364](https://github.com/casey/intermodal/pull/364)) - _Casey Rodarmor <casey@rodarmor.com>_
- :bug: [`xxxxxxxxxxxx`](https://github.com/casey/intermodal/commits/master) Fix Z Shell completions ([#365](https://github.com/casey/intermodal/pull/365)) - _Casey Rodarmor <casey@rodarmor.com>_
- :books: [`f05807290b31`](https://github.com/casey/intermodal/commit/f05807290b314cd68e8679a9aba92e5cd3c5403d) Render command help text in book to avoid wrapping ([#364](https://github.com/casey/intermodal/pull/364)) - _Casey Rodarmor <casey@rodarmor.com>_
- :books: [`ed34ff48a740`](https://github.com/casey/intermodal/commit/ed34ff48a7406adb8b4cdb523b5dc1bf9435e1bc) Add `fuchsi/maketorrent` to prior art table ([#362](https://github.com/casey/intermodal/pull/362)) - _Casey Rodarmor <casey@rodarmor.com>_
- :books: [`a3f46187229f`](https://github.com/casey/intermodal/commit/a3f46187229f499e7a13ec5ce656408ba95d1dcc) Rename distributing large datasets ([#361](https://github.com/casey/intermodal/pull/361)) - _Casey Rodarmor <casey@rodarmor.com>_
- :books: [`1c9ff0cde491`](https://github.com/casey/intermodal/commit/1c9ff0cde4910f369e75930257ce92a8cf4c6cd5) Add suggestions for distributing large datasets to book ([#360](https://github.com/casey/intermodal/pull/360)) - _Casey Rodarmor <casey@rodarmor.com>_
Expand Down
2 changes: 1 addition & 1 deletion book/src/commands/imdl-torrent-create.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `imdl torrent create`
```
imdl-torrent-create 0.1.4
Create a `.torrent` file.
Create a .torrent file.
USAGE:
imdl torrent create [FLAGS] [OPTIONS] --input <PATH>
Expand Down
2 changes: 1 addition & 1 deletion book/src/commands/imdl-torrent-link.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `imdl torrent link`
```
imdl-torrent-link 0.1.4
Generate a magnet link from a `.torrent` file.
Generate a magnet link from a .torrent file.
USAGE:
imdl torrent link [FLAGS] [OPTIONS] --input <METAINFO>
Expand Down
2 changes: 1 addition & 1 deletion book/src/commands/imdl-torrent-show.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `imdl torrent show`
```
imdl-torrent-show 0.1.4
Display information about a `.torrent` file.
Display information about a .torrent file.
USAGE:
imdl torrent show --input <PATH>
Expand Down
2 changes: 1 addition & 1 deletion book/src/commands/imdl-torrent-stats.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `imdl torrent stats`
```
imdl-torrent-stats 0.1.4
Show statistics about a collection of `.torrent` files.
Show statistics about a collection of .torrent files.
USAGE:
imdl torrent stats [FLAGS] [OPTIONS] --input <PATH>
Expand Down
2 changes: 1 addition & 1 deletion book/src/commands/imdl-torrent-verify.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# `imdl torrent verify`
```
imdl-torrent-verify 0.1.4
Verify files against a `.torrent` file.
Verify files against a .torrent file.
USAGE:
imdl torrent verify [OPTIONS] --input <METAINFO>
Expand Down
10 changes: 5 additions & 5 deletions book/src/commands/imdl-torrent.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ FLAGS:
-V, --version Print version number.
SUBCOMMANDS:
create Create a `.torrent` file.
create Create a .torrent file.
help Prints this message or the help of the given
subcommand(s)
link Generate a magnet link from a `.torrent` file.
link Generate a magnet link from a .torrent file.
piece-length Display information about automatic piece length
selection.
show Display information about a `.torrent` file.
stats Show statistics about a collection of `.torrent` files.
verify Verify files against a `.torrent` file.
show Display information about a .torrent file.
stats Show statistics about a collection of .torrent files.
verify Verify files against a .torrent file.
```
10 changes: 5 additions & 5 deletions completions/imdl.elvish
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ edit:completion:arg-completer[imdl] = [@words]{
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 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 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'= {
Expand Down
10 changes: 5 additions & 5 deletions completions/imdl.fish
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ complete -c imdl -n "__fish_use_subcommand" -f -a "completions" -d 'Print shell
complete -c imdl -n "__fish_use_subcommand" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -s h -l help -d 'Print help message.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -s V -l version -d 'Print version number.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "create" -d 'Create a `.torrent` file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "link" -d 'Generate a magnet link from a `.torrent` file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "create" -d 'Create a .torrent file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "link" -d 'Generate a magnet link from a .torrent file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "piece-length" -d 'Display information about automatic piece length selection.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "show" -d 'Display information about a `.torrent` file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "stats" -d 'Show statistics about a collection of `.torrent` files.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "verify" -d 'Verify files against a `.torrent` file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "show" -d 'Display information about a .torrent file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "stats" -d 'Show statistics about a collection of .torrent files.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "verify" -d 'Verify files against a .torrent file.'
complete -c imdl -n "__fish_seen_subcommand_from torrent" -f -a "help" -d 'Prints this message or the help of the given subcommand(s)'
complete -c imdl -n "__fish_seen_subcommand_from create" -s a -l announce -d 'Use `URL` as the primary tracker announce URL. To supply multiple announce URLs, also use `--announce-tier`.'
complete -c imdl -n "__fish_seen_subcommand_from create" -s A -l allow -d '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.' -r -f -a "private-trackerless small-piece-length uneven-piece-length"
Expand Down
10 changes: 5 additions & 5 deletions completions/imdl.powershell
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Register-ArgumentCompleter -Native -CommandName 'imdl' -ScriptBlock {
[CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print help message.')
[CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Print version number.')
[CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Print version number.')
[CompletionResult]::new('create', 'create', [CompletionResultType]::ParameterValue, 'Create a `.torrent` file.')
[CompletionResult]::new('link', 'link', [CompletionResultType]::ParameterValue, 'Generate a magnet link from a `.torrent` file.')
[CompletionResult]::new('create', 'create', [CompletionResultType]::ParameterValue, 'Create a .torrent file.')
[CompletionResult]::new('link', 'link', [CompletionResultType]::ParameterValue, 'Generate a magnet link from a .torrent file.')
[CompletionResult]::new('piece-length', 'piece-length', [CompletionResultType]::ParameterValue, 'Display information about automatic piece length selection.')
[CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display information about a `.torrent` file.')
[CompletionResult]::new('stats', 'stats', [CompletionResultType]::ParameterValue, 'Show statistics about a collection of `.torrent` files.')
[CompletionResult]::new('verify', 'verify', [CompletionResultType]::ParameterValue, 'Verify files against a `.torrent` file.')
[CompletionResult]::new('show', 'show', [CompletionResultType]::ParameterValue, 'Display information about a .torrent file.')
[CompletionResult]::new('stats', 'stats', [CompletionResultType]::ParameterValue, 'Show statistics about a collection of .torrent files.')
[CompletionResult]::new('verify', 'verify', [CompletionResultType]::ParameterValue, 'Verify files against a .torrent file.')
[CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Prints this message or the help of the given subcommand(s)')
break
}
Expand Down
10 changes: 5 additions & 5 deletions completions/imdl.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,12 @@ _imdl__torrent__stats_commands() {
(( $+functions[_imdl__torrent_commands] )) ||
_imdl__torrent_commands() {
local commands; commands=(
"create:Create a `.torrent` file." \
"link:Generate a magnet link from a `.torrent` file." \
"create:Create a .torrent file." \
"link:Generate a magnet link from a .torrent file." \
"piece-length:Display information about automatic piece length selection." \
"show:Display information about a `.torrent` file." \
"stats:Show statistics about a collection of `.torrent` files." \
"verify:Verify files against a `.torrent` file." \
"show:Display information about a .torrent file." \
"stats:Show statistics about a collection of .torrent files." \
"verify:Verify files against a .torrent file." \
"help:Prints this message or the help of the given subcommand(s)" \
)
_describe -t commands 'imdl torrent commands' commands "$@"
Expand Down
2 changes: 1 addition & 1 deletion man/imdl-torrent-create.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.TH IMDL-TORRENT-CREATE "1" "April 2020" "Intermodal v0.1.4" "Intermodal Manual"
.SH NAME
\fBimdl\ torrent\ create\fR
- Create a `.torrent` file.
- Create a .torrent file.
.SH "SYNOPSIS:"
.IP
imdl torrent create [FLAGS] [OPTIONS] \fB\-\-input\fR <PATH>
Expand Down
2 changes: 1 addition & 1 deletion man/imdl-torrent-link.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.TH IMDL-TORRENT-LINK "1" "April 2020" "Intermodal v0.1.4" "Intermodal Manual"
.SH NAME
\fBimdl\ torrent\ link\fR
- Generate a magnet link from a `.torrent` file.
- Generate a magnet link from a .torrent file.
.SH "SYNOPSIS:"
.IP
imdl torrent link [FLAGS] [OPTIONS] \fB\-\-input\fR <METAINFO>
Expand Down
2 changes: 1 addition & 1 deletion man/imdl-torrent-show.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.TH IMDL-TORRENT-SHOW "1" "April 2020" "Intermodal v0.1.4" "Intermodal Manual"
.SH NAME
\fBimdl\ torrent\ show\fR
- Display information about a `.torrent` file.
- Display information about a .torrent file.
.SH "SYNOPSIS:"
.IP
imdl torrent show \fB\-\-input\fR <PATH>
Expand Down
2 changes: 1 addition & 1 deletion man/imdl-torrent-stats.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.TH IMDL-TORRENT-STATS "1" "April 2020" "Intermodal v0.1.4" "Intermodal Manual"
.SH NAME
\fBimdl\ torrent\ stats\fR
- Show statistics about a collection of `.torrent` files.
- Show statistics about a collection of .torrent files.
.SH "SYNOPSIS:"
.IP
imdl torrent stats [FLAGS] [OPTIONS] \fB\-\-input\fR <PATH>
Expand Down
2 changes: 1 addition & 1 deletion man/imdl-torrent-verify.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.TH IMDL-TORRENT-VERIFY "1" "April 2020" "Intermodal v0.1.4" "Intermodal Manual"
.SH NAME
\fBimdl\ torrent\ verify\fR
- Verify files against a `.torrent` file.
- Verify files against a .torrent file.
.SH "SYNOPSIS:"
.IP
imdl torrent verify [OPTIONS] \fB\-\-input\fR <METAINFO>
Expand Down
10 changes: 5 additions & 5 deletions man/imdl-torrent.1
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ Print version number.
.SH "SUBCOMMANDS:"
.TP
create
Create a `.torrent` file.
Create a .torrent file.
.TP
help
Prints this message or the help of the given subcommand(s)
.TP
link
Generate a magnet link from a `.torrent` file.
Generate a magnet link from a .torrent file.
.TP
piece\-length
Display information about automatic piece length selection.
.TP
show
Display information about a `.torrent` file.
Display information about a .torrent file.
.TP
stats
Show statistics about a collection of `.torrent` files.
Show statistics about a collection of .torrent files.
.TP
verify
Verify files against a `.torrent` file.
Verify files against a .torrent file.
2 changes: 1 addition & 1 deletion src/subcommand/torrent/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod create_step;
#[structopt(
help_message(consts::HELP_MESSAGE),
version_message(consts::VERSION_MESSAGE),
about("Create a `.torrent` file.")
about("Create a .torrent file.")
)]
pub(crate) struct Create {
#[structopt(
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/torrent/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::common::*;
#[structopt(
help_message(consts::HELP_MESSAGE),
version_message(consts::VERSION_MESSAGE),
about("Generate a magnet link from a `.torrent` file.")
about("Generate a magnet link from a .torrent file.")
)]
pub(crate) struct Link {
#[structopt(
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/torrent/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::common::*;
#[structopt(
help_message(consts::HELP_MESSAGE),
version_message(consts::VERSION_MESSAGE),
about("Display information about a `.torrent` file.")
about("Display information about a .torrent file.")
)]
pub(crate) struct Show {
#[structopt(
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/torrent/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::common::*;
#[structopt(
help_message(consts::HELP_MESSAGE),
version_message(consts::VERSION_MESSAGE),
about("Show statistics about a collection of `.torrent` files.")
about("Show statistics about a collection of .torrent files.")
)]
pub(crate) struct Stats {
#[structopt(
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/torrent/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod verify_step;
#[structopt(
help_message(consts::HELP_MESSAGE),
version_message(consts::VERSION_MESSAGE),
about("Verify files against a `.torrent` file.")
about("Verify files against a .torrent file.")
)]
pub(crate) struct Verify {
#[structopt(
Expand Down

0 comments on commit 727d5c1

Please sign in to comment.