@@ -7,8 +7,10 @@ use std::path::PathBuf;
7
7
use std:: rc:: Rc ;
8
8
use std:: sync:: Arc ;
9
9
10
+ use clap:: { Parser , ValueHint } ;
11
+
10
12
/// Create an archive.
11
- #[ derive( clap :: Parser , Debug ) ]
13
+ #[ derive( Parser , Debug ) ]
12
14
pub struct Options {
13
15
/// File path of the archive to create.
14
16
///
@@ -18,18 +20,19 @@ pub struct Options {
18
20
short = 'f' ,
19
21
long = "file" ,
20
22
value_parser,
21
- required_unless_present( "list_compressions" )
23
+ required_unless_present( "list_compressions" ) ,
24
+ value_hint=ValueHint :: FilePath
22
25
) ]
23
26
outfile : Option < PathBuf > ,
24
27
25
28
/// Remove STRIP_PREFIX from the entries' name added to the archive.
26
- #[ arg( long, required = false ) ]
29
+ #[ arg( long, required = false , value_hint= ValueHint :: DirPath ) ]
27
30
strip_prefix : Option < arx:: PathBuf > ,
28
31
29
32
/// Move to BASE_DIR before starting adding content to arx archive.
30
33
///
31
34
/// Argument `INFILES` or `STRIP_PREFIX` must be relative to `BASE_DIR`.
32
- #[ arg( short = 'C' , required = false ) ]
35
+ #[ arg( short = 'C' , required = false , value_hint= ValueHint :: DirPath ) ]
33
36
base_dir : Option < PathBuf > ,
34
37
35
38
/// Input files/directories
@@ -38,7 +41,7 @@ pub struct Options {
38
41
///
39
42
/// In this mode `recurse` is true by default.
40
43
/// Use `--no-recurse` to avoid recursion.
41
- #[ arg( value_parser, group = "input" ) ]
44
+ #[ arg( value_parser, group = "input" , value_hint= ValueHint :: AnyPath ) ]
42
45
infiles : Vec < PathBuf > ,
43
46
44
47
/// Get the list of files/directories to add from the FILE_LIST (incompatible with INFILES)
@@ -48,7 +51,7 @@ pub struct Options {
48
51
/// In this mode, `recurse` is false by default.
49
52
/// This allow FILE_LIST listing both the directory and (subset of) files in the given directory.
50
53
/// Use `--recurse` to activate recursion.
51
- #[ arg( short = 'L' , long = "file-list" , group = "input" , verbatim_doc_comment) ]
54
+ #[ arg( short = 'L' , long = "file-list" , group = "input" , verbatim_doc_comment, value_hint= ValueHint :: FilePath ) ]
52
55
file_list : Option < PathBuf > ,
53
56
54
57
/// Recurse in directories
0 commit comments