Skip to content

Commit

Permalink
Specify value_hint macro for better completion
Browse files Browse the repository at this point in the history
  • Loading branch information
sudotac committed Feb 3, 2024
1 parent fae9ce6 commit e884298
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/command/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub use encode::*;
pub use vmaf::*;

use crate::{command::encode::default_output_ext, ffprobe::Ffprobe};
use clap::Parser;
use clap::{Parser, ValueHint};
use std::{
path::{Path, PathBuf},
sync::Arc,
Expand All @@ -19,7 +19,7 @@ pub struct EncodeToOutput {
/// Output file, by default the same as input with `.av1` before the extension.
///
/// E.g. if unspecified: -i vid.mkv --> vid.av1.mkv
#[arg(short, long)]
#[arg(short, long, value_hint = ValueHint::FilePath)]
pub output: Option<PathBuf>,

/// Set the output ffmpeg audio codec.
Expand Down Expand Up @@ -69,7 +69,7 @@ pub struct Sample {

/// Directory to store temporary sample data in.
/// Defaults to using the input's directory.
#[arg(long, env = "AB_AV1_TEMP_DIR")]
#[arg(long, env = "AB_AV1_TEMP_DIR", value_hint = ValueHint::DirPath)]
pub temp_dir: Option<PathBuf>,

/// Extension preference for encoded samples (ffmpeg encoder only).
Expand Down
4 changes: 2 additions & 2 deletions src/command/args/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
float::TerseF32,
};
use anyhow::ensure;
use clap::Parser;
use clap::{Parser, ValueHint};
use std::{
collections::HashMap,
fmt::{self, Write},
Expand All @@ -23,7 +23,7 @@ pub struct Encode {
pub encoder: Encoder,

/// Input video file.
#[arg(short, long)]
#[arg(short, long, value_hint = ValueHint::FilePath)]
pub input: PathBuf,

/// Ffmpeg video filter applied to the input before av1 encoding.
Expand Down

0 comments on commit e884298

Please sign in to comment.