Skip to content

Commit

Permalink
feat(cli): add dirpath completion with value_hint
Browse files Browse the repository at this point in the history
  • Loading branch information
graelo committed Aug 18, 2022
1 parent 7690c99 commit d754072
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::env;
use std::path::PathBuf;

use clap::{ArgAction, ArgGroup, Parser, Subcommand, ValueEnum};
use clap::{ArgAction, ArgGroup, Parser, Subcommand, ValueEnum, ValueHint};
use clap_complete::Shell;

use crate::management::Strategy;
Expand Down Expand Up @@ -98,7 +98,7 @@ pub struct Config {
///
/// If unspecified, it falls back on: `$XDG_STATE_HOME/tmux-revive`, then on
/// `$HOME/.local/state/tmux-revive`.
#[clap(short = 'd', long = "dirpath", default_value_os_t = default_backup_dirpath())]
#[clap(short = 'd', long = "dirpath", value_hint = ValueHint::DirPath, default_value_os_t = default_backup_dirpath())]
pub backup_dirpath: PathBuf,

/// Number of recent backups to keep, for instance 10.
Expand Down

0 comments on commit d754072

Please sign in to comment.