Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Rename --special-output to --output-specials
Browse files Browse the repository at this point in the history
  • Loading branch information
bytedream committed Nov 6, 2023
1 parent 787d8ab commit cd35dfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions crunchy-cli-core/src/archive/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct Archive {
#[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")]
#[arg(long)]
pub(crate) special_output: Option<String>,
pub(crate) output_specials: Option<String>,

#[arg(help = "Video resolution")]
#[arg(long_help = "The video resolution.\
Expand Down Expand Up @@ -131,7 +131,7 @@ impl Execute for Archive {
&& self.output != "-"
{
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)
.extension()
.unwrap_or_default()
Expand Down Expand Up @@ -197,7 +197,7 @@ impl Execute for Archive {

let formatted_path = if format.is_special() {
format.format_path(
self.special_output
self.output_specials
.as_ref()
.map_or((&self.output).into(), |so| so.into()),
)
Expand Down
8 changes: 4 additions & 4 deletions crunchy-cli-core/src/download/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct Download {
#[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")]
#[arg(long)]
pub(crate) special_output: Option<String>,
pub(crate) output_specials: Option<String>,

#[arg(help = "Video resolution")]
#[arg(long_help = "The video resolution.\
Expand Down Expand Up @@ -124,15 +124,15 @@ 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)
.extension()
.unwrap_or_default()
.is_empty()
&& !is_special_file(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 self.force_hardsub {
Expand Down Expand Up @@ -197,7 +197,7 @@ impl Execute for Download {

let formatted_path = if format.is_special() {
format.format_path(
self.special_output
self.output_specials
.as_ref()
.map_or((&self.output).into(), |so| so.into()),
)
Expand Down

0 comments on commit cd35dfe

Please sign in to comment.