Rename --special-output to --output-specials

This commit is contained in:
bytedream 2023-11-06 21:48:49 +01:00
parent 787d8ab02c
commit cd35dfe276
2 changed files with 7 additions and 7 deletions

View file

@ -58,7 +58,7 @@ pub struct Archive {
#[arg(long_help = "Name of the output file if the episode is a special. \ #[arg(long_help = "Name of the output file if the episode is a special. \
If not set, the '-o'/'--output' flag will be used as name template")] If not set, the '-o'/'--output' flag will be used as name template")]
#[arg(long)] #[arg(long)]
pub(crate) special_output: Option<String>, pub(crate) output_specials: Option<String>,
#[arg(help = "Video resolution")] #[arg(help = "Video resolution")]
#[arg(long_help = "The video resolution.\ #[arg(long_help = "The video resolution.\
@ -131,7 +131,7 @@ impl Execute for Archive {
&& self.output != "-" && self.output != "-"
{ {
bail!("File extension is not '.mkv'. Currently only matroska / '.mkv' files are supported") bail!("File extension is not '.mkv'. Currently only matroska / '.mkv' files are supported")
} else if let Some(special_output) = &self.special_output { } else if let Some(special_output) = &self.output_specials {
if PathBuf::from(special_output) if PathBuf::from(special_output)
.extension() .extension()
.unwrap_or_default() .unwrap_or_default()
@ -197,7 +197,7 @@ impl Execute for Archive {
let formatted_path = if format.is_special() { let formatted_path = if format.is_special() {
format.format_path( format.format_path(
self.special_output self.output_specials
.as_ref() .as_ref()
.map_or((&self.output).into(), |so| so.into()), .map_or((&self.output).into(), |so| so.into()),
) )

View file

@ -54,7 +54,7 @@ pub struct Download {
#[arg(long_help = "Name of the output file if the episode is a special. \ #[arg(long_help = "Name of the output file if the episode is a special. \
If not set, the '-o'/'--output' flag will be used as name template")] If not set, the '-o'/'--output' flag will be used as name template")]
#[arg(long)] #[arg(long)]
pub(crate) special_output: Option<String>, pub(crate) output_specials: Option<String>,
#[arg(help = "Video resolution")] #[arg(help = "Video resolution")]
#[arg(long_help = "The video resolution.\ #[arg(long_help = "The video resolution.\
@ -124,7 +124,7 @@ impl Execute for Download {
} }
} }
if let Some(special_output) = &self.special_output { if let Some(special_output) = &self.output_specials {
if Path::new(special_output) if Path::new(special_output)
.extension() .extension()
.unwrap_or_default() .unwrap_or_default()
@ -132,7 +132,7 @@ impl Execute for Download {
&& !is_special_file(special_output) && !is_special_file(special_output)
&& special_output != "-" && special_output != "-"
{ {
bail!("No file extension found. Please specify a file extension (via `--special-output`) for the output file") bail!("No file extension found. Please specify a file extension (via `--output-specials`) for the output file")
} }
if let Some(ext) = Path::new(special_output).extension() { if let Some(ext) = Path::new(special_output).extension() {
if self.force_hardsub { if self.force_hardsub {
@ -197,7 +197,7 @@ impl Execute for Download {
let formatted_path = if format.is_special() { let formatted_path = if format.is_special() {
format.format_path( format.format_path(
self.special_output self.output_specials
.as_ref() .as_ref()
.map_or((&self.output).into(), |so| so.into()), .map_or((&self.output).into(), |so| so.into()),
) )