Skip to content

Commit

Permalink
Fix filename completion (#188)
Browse files Browse the repository at this point in the history
* Bump clap_complete to 4.4.10

* Specify value_hint macro for better completion

Fix #180
  • Loading branch information
sudotac authored Feb 3, 2024
1 parent 7c0e1a9 commit 97ab8b0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
anyhow = "1.0.53"
blake3 = "1.3.3"
clap = { version = "4", features = ["derive", "env", "wrap_help"] }
clap_complete = "4"
clap_complete = "4.4.10"
console = "0.15.4"
dirs = "5"
fastrand = "2"
Expand Down
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 97ab8b0

Please sign in to comment.