change --transcode-preset to --preset
This commit is contained in:
parent
8624dd7a2f
commit
d9154f3373
|
@ -29,7 +29,7 @@ pub struct CopyCommandArgs {
|
|||
pub source: String,
|
||||
pub dest: String,
|
||||
#[clap(long)]
|
||||
pub transcode_preset: Option<String>,
|
||||
pub preset: Option<String>,
|
||||
#[clap(long)]
|
||||
pub transcode_config: Option<String>,
|
||||
#[clap(long)]
|
||||
|
@ -46,11 +46,11 @@ pub fn copy_command(
|
|||
_args: CLIArgs,
|
||||
copy_args: &CopyCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if copy_args.transcode_config.is_none() && copy_args.transcode_preset.is_none() {
|
||||
if copy_args.transcode_config.is_none() && copy_args.preset.is_none() {
|
||||
panic!("Please provide Transcode Preset/Config");
|
||||
}
|
||||
|
||||
if let Some(preset) = ©_args.transcode_preset {
|
||||
if let Some(preset) = ©_args.preset {
|
||||
if preset == "list" {
|
||||
print_presets();
|
||||
exit(0);
|
||||
|
@ -110,7 +110,7 @@ pub fn copy_command(
|
|||
}
|
||||
|
||||
if copy_args
|
||||
.transcode_preset
|
||||
.preset
|
||||
.as_ref()
|
||||
.unwrap_or(&"".to_string())
|
||||
== "copy"
|
||||
|
@ -228,7 +228,7 @@ fn transcode_files(
|
|||
copy_args: &CopyCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let transcode_config = transcode_preset_or_config(
|
||||
copy_args.transcode_preset.as_ref(),
|
||||
copy_args.preset.as_ref(),
|
||||
copy_args.transcode_config.as_ref(),
|
||||
)
|
||||
.expect("transcode config error");
|
||||
|
|
11
src/commands/stats.rs
Normal file
11
src/commands/stats.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use crate::args::CLIArgs;
|
||||
|
||||
#[derive(Debug, Clone, clap::Args)]
|
||||
pub struct StatsArgs {
|
||||
|
||||
}
|
||||
|
||||
|
||||
pub fn stats_command(args: CLIArgs, stats_args: &StatsArgs) -> Result<(), Box<dyn std::error::Error>> {
|
||||
Ok(())
|
||||
}
|
|
@ -17,7 +17,7 @@ pub struct TranscodeCommandArgs {
|
|||
pub source: String,
|
||||
pub dest: String,
|
||||
#[clap(long)]
|
||||
pub transcode_preset: Option<String>,
|
||||
pub preset: Option<String>,
|
||||
#[clap(long)]
|
||||
pub transcode_config: Option<String>,
|
||||
#[clap(long)]
|
||||
|
@ -30,7 +30,7 @@ pub fn transcode_command(
|
|||
_args: CLIArgs,
|
||||
transcode_args: &TranscodeCommandArgs,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
if let Some(preset) = &transcode_args.transcode_preset {
|
||||
if let Some(preset) = &transcode_args.preset {
|
||||
if preset == "list" {
|
||||
print_presets();
|
||||
exit(0);
|
||||
|
@ -38,7 +38,7 @@ pub fn transcode_command(
|
|||
}
|
||||
|
||||
let transcode_config = transcode_preset_or_config(
|
||||
transcode_args.transcode_preset.as_ref(),
|
||||
transcode_args.preset.as_ref(),
|
||||
transcode_args.transcode_config.as_ref(),
|
||||
)
|
||||
.expect("transcode config error");
|
||||
|
|
Loading…
Reference in a new issue