Skip to content

Commit

Permalink
Merge pull request #508 from ouch-org/add-completions-hints-to-clap
Browse files Browse the repository at this point in the history
completions: hint generator to expand to file paths
  • Loading branch information
figsoda authored Sep 12, 2023
2 parents c0e0531 + 7c6989d commit 09a75e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

_This changelog was created after v0.3.1 was released. As a result, there may be slight inaccuracies with versions <= v0.3.1._
_This changelog was created after v0.3.1. As a result, there may be slight inaccuracies with prior versions._

Categories Used:

Expand All @@ -24,6 +24,10 @@ Categories Used:

- Fix size unit inconsistency [\#502](https://github.com/ouch-org/ouch/pull/502) ([marcospb19](https://github.com/marcospb19))

### Improvements

- Hint completions generator to expand file paths [\#508](https://github.com/ouch-org/ouch/pull/508) ([marcospb19](https://github.com/marcospb19))

## [0.4.2](https://github.com/ouch-org/ouch/compare/0.4.1...0.4.2)

### New Features
Expand Down
8 changes: 4 additions & 4 deletions src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum Subcommand {
#[command(visible_alias = "c")]
Compress {
/// Files to be compressed
#[arg(required = true, num_args = 1..)]
#[arg(required = true, value_hint = ValueHint::FilePath)]
files: Vec<PathBuf>,

/// The resulting file. Its extensions can be used to specify the compression formats
Expand All @@ -78,18 +78,18 @@ pub enum Subcommand {
#[command(visible_alias = "d")]
Decompress {
/// Files to be decompressed
#[arg(required = true, num_args = 1..)]
#[arg(required = true, num_args = 1.., value_hint = ValueHint::FilePath)]
files: Vec<PathBuf>,

/// Place results in a directory other than the current one
#[arg(short = 'd', long = "dir", value_hint = ValueHint::DirPath)]
#[arg(short = 'd', long = "dir", value_hint = ValueHint::FilePath)]
output_dir: Option<PathBuf>,
},
/// List contents of an archive
#[command(visible_aliases = ["l", "ls"])]
List {
/// Archives whose contents should be listed
#[arg(required = true, num_args = 1..)]
#[arg(required = true, num_args = 1.., value_hint = ValueHint::FilePath)]
archives: Vec<PathBuf>,

/// Show archive contents as a tree
Expand Down

0 comments on commit 09a75e8

Please sign in to comment.