@@ -53,7 +53,7 @@ pub struct Args {
5353
5454 /// The amount of threads to use. Defaults to 0, indicating the amount of logical processors.
5555 /// Set to 1 to use only a single thread.
56- #[ clap( short = 't' , long = "threads" , default_value_t = DEFAULT_THREADS , global = true ) ]
56+ #[ clap( short = 't' , long = "threads" , default_value_t = DEFAULT_THREADS , global = true , env = "DUA_THREADS" ) ]
5757 pub threads : usize ,
5858
5959 /// The format with which to print byte counts.
@@ -64,25 +64,26 @@ pub struct Args {
6464 default_value_t = dft_format( ) ,
6565 ignore_case = true ,
6666 global = true ,
67+ env = "DUA_FORMAT" ,
6768 ) ]
6869 pub format : ByteFormat ,
6970
7071 /// Display apparent size instead of disk usage.
71- #[ clap( short = 'A' , long, global = true ) ]
72+ #[ clap( short = 'A' , long, global = true , env = "DUA_APPARENT_SIZE" ) ]
7273 pub apparent_size : bool ,
7374
7475 /// Count hard-linked files each time they are seen
75- #[ clap( short = 'l' , long, global = true ) ]
76+ #[ clap( short = 'l' , long, global = true , env = "DUA_COUNT_HARD_LINKS" ) ]
7677 pub count_hard_links : bool ,
7778
7879 /// If set, we will not cross filesystems or traverse mount points
79- #[ clap( short = 'x' , long, global = true ) ]
80+ #[ clap( short = 'x' , long, global = true , env = "DUA_STAY_ON_FILESYSTEM" ) ]
8081 pub stay_on_filesystem : bool ,
8182
8283 /// One or more absolute directories to ignore. Note that these are not ignored if they are passed as input path.
8384 ///
8485 /// Hence, they will only be ignored if they are eventually reached as part of the traversal.
85- #[ clap( long = "ignore-dirs" , short = 'i' , value_parser, global = true ) ]
86+ #[ clap( long = "ignore-dirs" , short = 'i' , value_parser, global = true , env = "DUA_IGNORE_DIRS" ) ]
8687 #[ cfg_attr( target_os = "linux" , clap( default_values = & [ "/proc" , "/dev" , "/sys" , "/run" ] ) ) ]
8788 pub ignore_dirs : Vec < PathBuf > ,
8889
@@ -91,7 +92,7 @@ pub struct Args {
9192 pub input : Vec < PathBuf > ,
9293
9394 /// Write a log file with debug information, including panics.
94- #[ clap( long, global = true ) ]
95+ #[ clap( long, global = true , env = "DUA_LOG_FILE" ) ]
9596 pub log_file : Option < PathBuf > ,
9697}
9798
0 commit comments