11use dua:: ByteFormat as LibraryByteFormat ;
22use std:: path:: PathBuf ;
33
4- #[ derive( PartialEq , Eq , Debug , Clone , Copy , clap:: ArgEnum ) ]
4+ #[ derive( PartialEq , Eq , Debug , Clone , Copy , clap:: ValueEnum ) ]
55pub enum ByteFormat {
66 Metric ,
77 Binary ,
@@ -50,7 +50,7 @@ pub struct Args {
5050 #[ clap(
5151 short = 'f' ,
5252 long,
53- arg_enum ,
53+ value_enum ,
5454 default_value_t = ByteFormat :: Metric ,
5555 ignore_case = true ,
5656 hide_default_value = true ,
@@ -73,12 +73,12 @@ pub struct Args {
7373 /// One or more absolute directories to ignore. Note that these are not ignored if they are passed as input path.
7474 ///
7575 /// Hence, they will only be ignored if they are eventually reached as part of the traversal.
76- #[ clap( long = "ignore-dirs" , short = 'i' , parse ( from_os_str ) ) ]
76+ #[ clap( long = "ignore-dirs" , short = 'i' , value_parser ) ]
7777 #[ cfg_attr( target_os = "linux" , clap( default_values = & [ "/proc" , "/dev" , "/sys" , "/run" ] ) ) ]
7878 pub ignore_dirs : Vec < PathBuf > ,
7979
8080 /// One or more input files or directories. If unset, we will use all entries in the current working directory.
81- #[ clap( parse ( from_os_str ) ) ]
81+ #[ clap( value_parser ) ]
8282 pub input : Vec < PathBuf > ,
8383}
8484
@@ -89,7 +89,7 @@ pub enum Command {
8989 #[ clap( name = "interactive" , visible_alias = "i" ) ]
9090 Interactive {
9191 /// One or more input files or directories. If unset, we will use all entries in the current working directory.
92- #[ clap( parse ( from_os_str ) ) ]
92+ #[ clap( value_parser ) ]
9393 input : Vec < PathBuf > ,
9494 } ,
9595 /// Aggregrate the consumed space of one or more directories or files
@@ -106,7 +106,7 @@ pub enum Command {
106106 #[ clap( long) ]
107107 no_total : bool ,
108108 /// One or more input files or directories. If unset, we will use all entries in the current working directory.
109- #[ clap( parse ( from_os_str ) ) ]
109+ #[ clap( value_parser ) ]
110110 input : Vec < PathBuf > ,
111111 } ,
112112}
0 commit comments