Skip to content
Myr

app.rs

This file

Path

src/app.rs

546 lines · 22.8 KiB · Rust

Last changed by

Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3

History of this file

Take it

The walk stopped after 200 commits: lines older than 8832e47 point at it.

[2018 edition] remove all extern crate lines from sourcesAlexandru Macoveibefore adoption051ff59

line 1why, one step back
1use clap::{crate_version, App, AppSettings, Arg};

Update man pagesharkdpbefore adoption8832e47

lines 2–3why, one step back
2
3pub fn build_app() -> App<'static, 'static> {

Small stylistic changesharkdpbefore adoptiona9c7696

line 4why, one step back
4 let mut app = App::new("fd")

Update man pagesharkdpbefore adoption8832e47

lines 5–8why, one step back
5 .version(crate_version!())
6 .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")7 .setting(AppSettings::ColoredHelp)8 .setting(AppSettings::DeriveDisplayOrder)

Formattingsharkdpbefore adoption33feb51

line 9why, one step back
9 .after_help(

Inline the help textssharkdpbefore adoptione2a7d34

lines 10–11why, one step back
10 "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \
11 details.",

Formattingsharkdpbefore adoption33feb51

line 12why, one step back
12 )

Update man pagesharkdpbefore adoption8832e47

line 13why, one step back
13 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 14why, one step back
14 Arg::with_name("hidden")

Fix idempotent flagsDeepansh Soodbefore adoption2664998

lines 15–16why, one step back
15 .long("hidden")
16 .short("H")

Inline the help textssharkdpbefore adoptione2a7d34

lines 17–23why, one step back
17 .overrides_with("hidden")
18 .help("Search hidden files and directories")19 .long_help(20 "Include hidden directories and files in the search results (default: \21 hidden files and directories are skipped). Files and directories are \22 considered to be hidden if their name starts with a `.` sign (dot).",23 ),

Fix idempotent flagsDeepansh Soodbefore adoption2664998

lines 24–25why, one step back
24 )
25 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 26why, one step back
26 Arg::with_name("no-ignore")

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 27–28why, one step back
27 .long("no-ignore")
28 .short("I")

Inline the help textssharkdpbefore adoptione2a7d34

lines 29–34why, one step back
29 .overrides_with("no-ignore")
30 .help("Do not respect .(git|fd)ignore files")31 .long_help(32 "Show search results from files and directories that would otherwise be \33 ignored by '.gitignore', '.ignore' or '.fdignore' files.",34 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 35–36why, one step back
35 )
36 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 37why, one step back
37 Arg::with_name("no-ignore-vcs")

Fix CI errorDeepanshbefore adoptiona6ed0fc

line 38why, one step back
38 .long("no-ignore-vcs")

Inline the help textssharkdpbefore adoptione2a7d34

line 39why, one step back
39 .overrides_with("no-ignore-vcs")

Remove two options from short -h help textsharkdpbefore adoption1a96544

line 40why, one step back
40 .hidden_short_help(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 41–44why, one step back
41 .long_help(
42 "Show search results from files and directories that would otherwise be \43 ignored by '.gitignore' files.",44 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 45–46why, one step back
45 )
46 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 47why, one step back
47 Arg::with_name("rg-alias-hidden-ignore")

Update man pagesharkdpbefore adoption8832e47

line 48why, one step back
48 .short("u")

Expand help for `-u`, add to manpageNathan Henriebefore adoption59c27ba

line 49why, one step back
49 .long("unrestricted")

Update man pagesharkdpbefore adoption8832e47

line 50why, one step back
50 .multiple(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 51–55why, one step back
51 .hidden_short_help(true)
52 .long_help(53 "Alias for '--no-ignore'. Can be repeated. '-uu' is an alias for \54 '--no-ignore --hidden'.",55 ),

Update man pagesharkdpbefore adoption8832e47

lines 56–57why, one step back
56 )
57 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 58why, one step back
58 Arg::with_name("case-sensitive")

Update man pagesharkdpbefore adoption8832e47

lines 59–60why, one step back
59 .long("case-sensitive")
60 .short("s")

Inline the help textssharkdpbefore adoptione2a7d34

lines 61–67why, one step back
61 .overrides_with_all(&["ignore-case", "case-sensitive"])
62 .help("Case-sensitive search (default: smart case)")63 .long_help(64 "Perform a case-sensitive search. By default, fd uses case-insensitive \65 searches, unless the pattern contains an uppercase character (smart \66 case).",67 ),

Update man pagesharkdpbefore adoption8832e47

lines 68–69why, one step back
68 )
69 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 70why, one step back
70 Arg::with_name("ignore-case")

Update man pagesharkdpbefore adoption8832e47

lines 71–72why, one step back
71 .long("ignore-case")
72 .short("i")

Inline the help textssharkdpbefore adoptione2a7d34

lines 73–79why, one step back
73 .overrides_with_all(&["case-sensitive", "ignore-case"])
74 .help("Case-insensitive search (default: smart case)")75 .long_help(76 "Perform a case-insensitive search. By default, fd uses case-insensitive \77 searches, unless the pattern contains an uppercase character (smart \78 case).",79 ),

Update man pagesharkdpbefore adoption8832e47

lines 80–81why, one step back
80 )
81 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 82why, one step back
82 Arg::with_name("glob")

Implement glob-based searchessharkdpbefore adoptiond5da615

lines 83–84why, one step back
83 .long("glob")
84 .short("g")

Fix idempotent flagsDeepansh Soodbefore adoption2664998

line 85why, one step back
85 .conflicts_with("fixed-strings")

Inline the help textssharkdpbefore adoptione2a7d34

lines 86–88why, one step back
86 .overrides_with("glob")
87 .help("Glob-based search (default: regular expression)")88 .long_help("Perform a glob-based search instead of a regular expression search."),

Implement glob-based searchessharkdpbefore adoptiond5da615

lines 89–90why, one step back
89 )
90 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 91why, one step back
91 Arg::with_name("regex")

Add --regex option to override --globsharkdpbefore adoptioneac20a8

line 92why, one step back
92 .long("regex")

Fix idempotent flagsDeepansh Soodbefore adoption2664998

line 93why, one step back
93 .overrides_with_all(&["glob", "regex"])

Inline the help textssharkdpbefore adoptione2a7d34

lines 94–98why, one step back
94 .hidden_short_help(true)
95 .long_help(96 "Perform a regular-expression based search (default). This can be used to \97 override --glob.",98 ),

Add --regex option to override --globsharkdpbefore adoptioneac20a8

lines 99–100why, one step back
99 )
100 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 101why, one step back
101 Arg::with_name("fixed-strings")

Update man pagesharkdpbefore adoption8832e47

lines 102–103why, one step back
102 .long("fixed-strings")
103 .short("F")

Fix idempotent flagsDeepansh Soodbefore adoption2664998

line 104why, one step back
104 .alias("literal")

Inline the help textssharkdpbefore adoptione2a7d34

line 105why, one step back
105 .overrides_with("fixed-strings")

Remove two options from short -h help textsharkdpbefore adoption1a96544

line 106why, one step back
106 .hidden_short_help(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 107–109why, one step back
107 .long_help(
108 "Treat the pattern as a literal string instead of a regular expression.",109 ),

Update man pagesharkdpbefore adoption8832e47

line 110why, one step back
110 )

Fix CI errorDeepanshbefore adoptiona6ed0fc

line 111why, one step back
111 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 112why, one step back
112 Arg::with_name("absolute-path")

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 113–114why, one step back
113 .long("absolute-path")
114 .short("a")

Inline the help textssharkdpbefore adoptione2a7d34

lines 115–119why, one step back
115 .overrides_with("absolute-path")
116 .help("Show absolute instead of relative paths")117 .long_help(118 "Shows the full path starting from the root as opposed to relative paths.",119 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 120–121why, one step back
120 )
121 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 122why, one step back
122 Arg::with_name("list-details")

Rename --list to --list-detailssharkdpbefore adoptionc9dc617

line 123why, one step back
123 .long("list-details")

Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12

line 124why, one step back
124 .short("l")

Inline the help textssharkdpbefore adoptione2a7d34

line 125why, one step back
125 .conflicts_with("absolute-path")

Adapt --list-details help messagesharkdpbefore adoption2cfb1a2

line 126why, one step back
126 .help("Use a long listing format with file metadata")

Inline the help textssharkdpbefore adoptione2a7d34

lines 127–132why, one step back
127 .long_help(
128 "Use a detailed listing format like 'ls -l'. This is basically an alias \129 for '--exec-batch ls -l' with some additional 'ls' options. This can be \130 used to see more metadata, to show symlink targets and to achieve a \131 deterministic sort order.",132 ),

Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12

lines 133–134why, one step back
133 )
134 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 135why, one step back
135 Arg::with_name("follow")

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 136–138why, one step back
136 .long("follow")
137 .short("L")138 .alias("dereference")

Inline the help textssharkdpbefore adoptione2a7d34

lines 139–144why, one step back
139 .overrides_with("follow")
140 .help("Follow symbolic links")141 .long_help(142 "By default, fd does not descend into symlinked directories. Using this \143 flag, symbolic links are also traversed.",144 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 145–146why, one step back
145 )
146 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 147why, one step back
147 Arg::with_name("full-path")

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 148–149why, one step back
148 .long("full-path")
149 .short("p")

Inline the help textssharkdpbefore adoptione2a7d34

lines 150–156why, one step back
150 .overrides_with("full-path")
151 .help("Search full path (default: file-/dirname only)")152 .long_help(153 "By default, the search pattern is only matched against the filename (or \154 directory name). Using this flag, the pattern is matched against the \155 full path.",156 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 157–158why, one step back
157 )
158 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 159why, one step back
159 Arg::with_name("null_separator")

Fix CI errorDeepanshbefore adoptiona6ed0fc

lines 160–161why, one step back
160 .long("print0")
161 .short("0")

Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12

line 162why, one step back
162 .overrides_with("print0")

Inline the help textssharkdpbefore adoptione2a7d34

lines 163–168why, one step back
163 .conflicts_with("list-details")
164 .help("Separate results by the null character")165 .long_help(166 "Separate search results by the null character (instead of newlines). \167 Useful for piping results to 'xargs'.",168 ),

Fix CI errorDeepanshbefore adoptiona6ed0fc

line 169why, one step back
169 )

Inline the help textssharkdpbefore adoptione2a7d34

line 170why, one step back
170 .arg(

Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b

line 171why, one step back
171 Arg::with_name("max-depth")

Inline the help textssharkdpbefore adoptione2a7d34

lines 172–174why, one step back
172 .long("max-depth")
173 .short("d")174 .takes_value(true)

Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b

line 175why, one step back
175 .value_name("depth")

Inline the help textssharkdpbefore adoptione2a7d34

lines 176–181why, one step back
176 .help("Set maximum search depth (default: none)")
177 .long_help(178 "Limit the directory traversal to a given depth. By default, there is no \179 limit on the search depth.",180 ),181 )

Update man pagesharkdpbefore adoption8832e47

lines 182–183why, one step back
182 // support --maxdepth as well, for compatibility with rg
183 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 184why, one step back
184 Arg::with_name("rg-depth")

Update man pagesharkdpbefore adoption8832e47

lines 185–186why, one step back
185 .long("maxdepth")
186 .hidden(true)

Inline the help textssharkdpbefore adoptione2a7d34

line 187why, one step back
187 .takes_value(true)

Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b

lines 188–210why, one step back
188 )
189 .arg(190 Arg::with_name("min-depth")191 .long("min-depth")192 .takes_value(true)193 .value_name("depth")194 .hidden_short_help(true)195 .long_help(196 "Only show search results starting at the given depth. \197 See also: '--max-depth' and '--exact-depth'",198 ),199 )200 .arg(201 Arg::with_name("exact-depth")202 .long("exact-depth")203 .takes_value(true)204 .value_name("depth")205 .hidden_short_help(true)206 .conflicts_with_all(&["max-depth", "min-depth"])207 .long_help(208 "Only show search results at the exact given depth. This is an alias for \209 '--min-depth <depth> --max-depth <depth>'.",210 ),

Update man pagesharkdpbefore adoption8832e47

lines 211–212why, one step back
211 )
212 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 213why, one step back
213 Arg::with_name("file-type")

Update man pagesharkdpbefore adoption8832e47

lines 214–230why, one step back
214 .long("type")
215 .short("t")216 .multiple(true)217 .number_of_values(1)218 .takes_value(true)219 .value_name("filetype")220 .possible_values(&[221 "f",222 "file",223 "d",224 "directory",225 "l",226 "symlink",227 "x",228 "executable",229 "e",230 "empty",

Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add

lines 231–234why, one step back
231 "s",
232 "socket",233 "p",234 "pipe",

Update man pagesharkdpbefore adoption8832e47

line 235why, one step back
235 ])

Inline the help textssharkdpbefore adoptione2a7d34

lines 236–238why, one step back
236 .hide_possible_values(true)
237 .help(238 "Filter by type: file (f), directory (d), symlink (l),\nexecutable (x), \

Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add

line 239why, one step back
239 empty (e), socket (s), pipe (p)",

Inline the help textssharkdpbefore adoptione2a7d34

lines 240–246why, one step back
240 )
241 .long_help(242 "Filter the search by type (multiple allowable filetypes can be specified):\n \243 'f' or 'file': regular files\n \244 'd' or 'directory': directories\n \245 'l' or 'symlink': symbolic links\n \246 'x' or 'executable': executables\n \

Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add

lines 247–249why, one step back
247 'e' or 'empty': empty files or directories\n \
248 's' or 'socket': socket\n \249 'p' or 'pipe': named pipe (FIFO)",

Inline the help textssharkdpbefore adoptione2a7d34

line 250why, one step back
250 ),

Update man pagesharkdpbefore adoption8832e47

lines 251–252why, one step back
251 )
252 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 253why, one step back
253 Arg::with_name("extension")

Update man pagesharkdpbefore adoption8832e47

lines 254–258why, one step back
254 .long("extension")
255 .short("e")256 .multiple(true)257 .number_of_values(1)258 .takes_value(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 259–264why, one step back
259 .value_name("ext")
260 .help("Filter by file extension")261 .long_help(262 "(Additionally) filter search results by their file extension. Multiple \263 allowable file extensions can be specified.",264 ),

Update man pagesharkdpbefore adoption8832e47

lines 265–266why, one step back
265 )
266 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 267why, one step back
267 Arg::with_name("exec")

Update man pagesharkdpbefore adoption8832e47

lines 268–272why, one step back
268 .long("exec")
269 .short("x")270 .min_values(1)271 .allow_hyphen_values(true)272 .value_terminator(";")

Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12

line 273why, one step back
273 .value_name("cmd")

Inline the help textssharkdpbefore adoptione2a7d34

lines 274–287why, one step back
274 .conflicts_with("list-details")
275 .help("Execute a command for each search result")276 .long_help(277 "Execute a command for each search result.\n\278 All arguments following --exec are taken to be arguments to the command until the \279 argument ';' is encountered.\n\280 Each occurrence of the following placeholders is substituted by a path derived from the \281 current search result before the command is executed:\n \282 '{}': path\n \283 '{/}': basename\n \284 '{//}': parent directory\n \285 '{.}': path without file extension\n \286 '{/.}': basename without file extension",287 ),

Update man pagesharkdpbefore adoption8832e47

lines 288–289why, one step back
288 )
289 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 290why, one step back
290 Arg::with_name("exec-batch")

Add support for batch execution of commandkimsnjbefore adoption45d1b15

lines 291–296why, one step back
291 .long("exec-batch")
292 .short("X")293 .min_values(1)294 .allow_hyphen_values(true)295 .value_terminator(";")296 .value_name("cmd")

Inline the help textssharkdpbefore adoptione2a7d34

lines 297–310why, one step back
297 .conflicts_with_all(&["exec", "list-details"])
298 .help("Execute a command with all search results at once")299 .long_help(300 "Execute a command with all search results at once.\n\301 All arguments following --exec-batch are taken to be arguments to the command until the \302 argument ';' is encountered.\n\303 A single occurrence of the following placeholders is authorized and substituted by the paths derived from the \304 search results before the command is executed:\n \305 '{}': path\n \306 '{/}': basename\n \307 '{//}': parent directory\n \308 '{.}': path without file extension\n \309 '{/.}': basename without file extension",310 ),

Add support for batch execution of commandkimsnjbefore adoption45d1b15

lines 311–312why, one step back
311 )
312 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 313why, one step back
313 Arg::with_name("exclude")

Update man pagesharkdpbefore adoption8832e47

lines 314–318why, one step back
314 .long("exclude")
315 .short("E")316 .takes_value(true)317 .value_name("pattern")318 .number_of_values(1)

Inline the help textssharkdpbefore adoptione2a7d34

lines 319–325why, one step back
319 .multiple(true)
320 .help("Exclude entries that match the given glob pattern")321 .long_help(322 "Exclude files/directories that match the given glob pattern. This \323 overrides any other ignore logic. Multiple exclude patterns can be \324 specified.",325 ),

Update man pagesharkdpbefore adoption8832e47

lines 326–327why, one step back
326 )
327 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 328why, one step back
328 Arg::with_name("ignore-file")

Update man pagesharkdpbefore adoption8832e47

lines 329–333why, one step back
329 .long("ignore-file")
330 .takes_value(true)331 .value_name("path")332 .number_of_values(1)333 .multiple(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 334–338why, one step back
334 .hidden_short_help(true)
335 .long_help(336 "Add a custom ignore-file in '.gitignore' format. These files have a low \337 precedence.",338 ),

Update man pagesharkdpbefore adoption8832e47

lines 339–340why, one step back
339 )
340 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 341why, one step back
341 Arg::with_name("color")

Update man pagesharkdpbefore adoption8832e47

lines 342–346why, one step back
342 .long("color")
343 .short("c")344 .takes_value(true)345 .value_name("when")346 .possible_values(&["never", "auto", "always"])

Inline the help textssharkdpbefore adoptione2a7d34

lines 347–354why, one step back
347 .hide_possible_values(true)
348 .help("When to use colors: never, *auto*, always")349 .long_help(350 "Declare when to use color for the pattern match output:\n \351 'auto': show colors if the output goes to an interactive console (default)\n \352 'never': do not use colorized output\n \353 'always': always use colorized output",354 ),

Update man pagesharkdpbefore adoption8832e47

lines 355–356why, one step back
355 )
356 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 357why, one step back
357 Arg::with_name("threads")

Update man pagesharkdpbefore adoption8832e47

lines 358–361why, one step back
358 .long("threads")
359 .short("j")360 .takes_value(true)361 .value_name("num")

Inline the help textssharkdpbefore adoptione2a7d34

lines 362–366why, one step back
362 .hidden_short_help(true)
363 .long_help(364 "Set number of threads to use for searching & executing (default: number \365 of available CPU cores)",366 ),

Update man pagesharkdpbefore adoption8832e47

lines 367–368why, one step back
367 )
368 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 369why, one step back
369 Arg::with_name("size")

Update man pagesharkdpbefore adoption8832e47

lines 370–374why, one step back
370 .long("size")
371 .short("S")372 .takes_value(true)373 .number_of_values(1)374 .allow_hyphen_values(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 375–393why, one step back
375 .multiple(true)
376 .help("Limit results based on the size of files.")377 .long_help(378 "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \379 '+': file size must be greater than or equal to this\n \380 '-': file size must be less than or equal to this\n \381 'NUM': The numeric size (e.g. 500)\n \382 'UNIT': The units for NUM. They are not case-sensitive.\n\383 Allowed unit values:\n \384 'b': bytes\n \385 'k': kilobytes\n \386 'm': megabytes\n \387 'g': gigabytes\n \388 't': terabytes\n \389 'ki': kibibytes\n \390 'mi': mebibytes\n \391 'gi': gibibytes\n \392 'ti': tebibytes",393 ),

Update man pagesharkdpbefore adoption8832e47

lines 394–395why, one step back
394 )
395 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 396why, one step back
396 Arg::with_name("max-buffer-time")

Update man pagesharkdpbefore adoption8832e47

lines 397–398why, one step back
397 .long("max-buffer-time")
398 .takes_value(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 399–403why, one step back
399 .hidden(true)
400 .long_help(401 "Amount of time in milliseconds to buffer, before streaming the search \402 results to the console.",403 ),

Update man pagesharkdpbefore adoption8832e47

lines 404–405why, one step back
404 )
405 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 406why, one step back
406 Arg::with_name("changed-within")

Update man pagesharkdpbefore adoption8832e47

lines 407–410why, one step back
407 .long("changed-within")
408 .alias("change-newer-than")409 .takes_value(true)410 .value_name("date|dur")

Inline the help textssharkdpbefore adoptione2a7d34

lines 411–420why, one step back
411 .number_of_values(1)
412 .help("Filter by file modification time (newer than)")413 .long_help(414 "Filter results based on the file modification time. The argument can be provided \415 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \416 '--change-newer-than' can be used as an alias.\n\417 Examples:\n \418 --changed-within 2weeks\n \419 --change-newer-than '2018-10-27 10:00:00'",420 ),

Update man pagesharkdpbefore adoption8832e47

lines 421–422why, one step back
421 )
422 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 423why, one step back
423 Arg::with_name("changed-before")

Update man pagesharkdpbefore adoption8832e47

lines 424–427why, one step back
424 .long("changed-before")
425 .alias("change-older-than")426 .takes_value(true)427 .value_name("date|dur")

Inline the help textssharkdpbefore adoptione2a7d34

lines 428–437why, one step back
428 .number_of_values(1)
429 .help("Filter by file modification time (older than)")430 .long_help(431 "Filter results based on the file modification time. The argument can be provided \432 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \433 '--change-older-than' can be used as an alias.\n\434 Examples:\n \435 --changed-before '2018-10-27 10:00:00'\n \436 --change-older-than 2weeks",437 ),

Update man pagesharkdpbefore adoption8832e47

lines 438–439why, one step back
438 )
439 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 440why, one step back
440 Arg::with_name("max-results")

Add --max-results=<count> optionsharkdpbefore adoptiond43827f

lines 441–443why, one step back
441 .long("max-results")
442 .takes_value(true)443 .value_name("count")

Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3

lines 444–449why, one step back
444 // We currently do not support --max-results in combination with
445 // program execution because the results that come up in a --max-results446 // search are non-deterministic. Users might think that they can run the447 // same search with `--exec rm` attached and get a reliable removal of448 // the files they saw in the previous search.449 .conflicts_with_all(&["exec", "exec-batch", "list-details"])

Inline the help textssharkdpbefore adoptione2a7d34

lines 450–451why, one step back
450 .hidden_short_help(true)
451 .long_help("Limit the number of search results to 'count' and quit immediately."),

Add --max-results=<count> optionsharkdpbefore adoptiond43827f

lines 452–453why, one step back
452 )
453 .arg(

Add alias -1 for --max-results=1Danny Möschbefore adoption2bab4a2

lines 454–457why, one step back
454 Arg::with_name("max-one-result")
455 .short("1")456 .hidden_short_help(true)457 .overrides_with("max-results")

Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3

line 458why, one step back
458 .conflicts_with_all(&["exec", "exec-batch", "list-details"])

Add alias -1 for --max-results=1Danny Möschbefore adoption2bab4a2

lines 459–462why, one step back
459 .long_help("Limit the search to a single result and quit immediately. \
460 This is an alias for '--max-results=1'.")461 )462 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 463why, one step back
463 Arg::with_name("show-errors")

Update man pagesharkdpbefore adoption8832e47

line 464why, one step back
464 .long("show-errors")

Fix idempotent flagsDeepansh Soodbefore adoption2664998

line 465why, one step back
465 .hidden_short_help(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 466–470why, one step back
466 .overrides_with("show-errors")
467 .long_help(468 "Enable the display of filesystem errors for situations such as \469 insufficient permissions or dead symlinks.",470 ),

Update man pagesharkdpbefore adoption8832e47

line 471why, one step back
471 )

Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5

line 472why, one step back
472 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 473why, one step back
473 Arg::with_name("base-directory")

Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5

lines 474–477why, one step back
474 .long("base-directory")
475 .takes_value(true)476 .value_name("path")477 .number_of_values(1)

Inline the help textssharkdpbefore adoptione2a7d34

lines 478–485why, one step back
478 .hidden_short_help(true)
479 .long_help(480 "Change the current working directory of fd to the provided path. The \481 means that search results will be shown with respect to the given base \482 path. Note that relative paths which are passed to fd via the positional \483 <path> argument or the '--search-path' option will also be resolved \484 relative to this directory.",485 ),

Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5

line 486why, one step back
486 )

Add path-separator option.Nathan Moreaubefore adoption24e108e

line 487why, one step back
487 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

lines 488–493why, one step back
488 Arg::with_name("pattern").help(
489 "the search pattern - a regular expression unless '--glob' is used (optional)",490 ),491 )492 .arg(493 Arg::with_name("path-separator")

Add path-separator option.Nathan Moreaubefore adoption24e108e

line 494why, one step back
494 .takes_value(true)

Amend clap configuration for path-separator.Nathan Moreaubefore adoption3857fa8

line 495why, one step back
495 .value_name("separator")

Add path-separator option.Nathan Moreaubefore adoption24e108e

line 496why, one step back
496 .long("path-separator")

Inline the help textssharkdpbefore adoptione2a7d34

lines 497–501why, one step back
497 .hidden_short_help(true)
498 .long_help(499 "Set the path separator to use when printing file paths. The default is \500 the OS-specific separator ('/' on Unix, '\\' on Windows).",501 ),

Add path-separator option.Nathan Moreaubefore adoption24e108e

line 502why, one step back
502 )

Update man pagesharkdpbefore adoption8832e47

line 503why, one step back
503 .arg(

Inline the help textssharkdpbefore adoptione2a7d34

lines 504–513why, one step back
504 Arg::with_name("path")
505 .multiple(true)506 .help("the root directory for the filesystem search (optional)")507 .long_help(508 "The directory where the filesystem search is rooted (optional). If \509 omitted, search the current working directory.",510 ),511 )512 .arg(513 Arg::with_name("search-path")

Update man pagesharkdpbefore adoption8832e47

lines 514–518why, one step back
514 .long("search-path")
515 .takes_value(true)516 .conflicts_with("path")517 .multiple(true)518 .hidden_short_help(true)

Inline the help textssharkdpbefore adoptione2a7d34

lines 519–524why, one step back
519 .number_of_values(1)
520 .long_help(521 "Provide paths to search as an alternative to the positional <path> \522 argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \523 --search-path <path2> [<pattern>]`",524 ),

Restrict `--one-file-system` to supported systemsSimon Engmannbefore adoptiondea1fbe

lines 525–528why, one step back
525 );
526527 // Make `--one-file-system` available only on Unix and Windows platforms, as per the528 // restrictions on the corresponding option in the `ignore` crate.

Add aliases for `--one-file-system`Simon Engmannbefore adoption6f7d108

line 529why, one step back
529 // Provide aliases `mount` and `xdev` for people coming from `find`.

Shorten `cfg!()` checksSimon Engmannbefore adoptioned6c184

line 530why, one step back
530 if cfg!(any(unix, windows)) {

Small stylistic changesharkdpbefore adoptiona9c7696

line 531why, one step back
531 app = app.arg(

Inline the help textssharkdpbefore adoptione2a7d34

line 532why, one step back
532 Arg::with_name("one-file-system")

Add aliases for `--one-file-system`Simon Engmannbefore adoption6f7d108

line 533why, one step back
533 .long("one-file-system")

Hide --one-file-system from the short help textsharkdpbefore adoptionc001dd4

line 534why, one step back
534 .aliases(&["mount", "xdev"])

Inline the help textssharkdpbefore adoptione2a7d34

lines 535–541why, one step back
535 .hidden_short_help(true)
536 .long_help(537 "By default, fd will traverse the file system tree as far as other options \538 dictate. With this flag, fd ensures that it does not descend into a \539 different file system than the one it started in. Comparable to the -mount \540 or -xdev filters of find(1).",541 ),

Small stylistic changesharkdpbefore adoptiona9c7696

line 542why, one step back
542 );

Restrict `--one-file-system` to supported systemsSimon Engmannbefore adoptiondea1fbe

line 543why, one step back
543 }

Small stylistic changesharkdpbefore adoptiona9c7696

lines 544–545why, one step back
544
545 app

Update man pagesharkdpbefore adoption8832e47

line 546why, one step back
546}