app.rs
This file
Path
src/app.rs
574 lines · 23.9 KiB · Rust
Last changed by
improve time option usage (#645)gorogoroumarubefore adoption74c3431
History of this fileTake it
The walk stopped after 200 commits: lines older than 3599a30 point at it.
Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 1–3why, one step back1use clap::{crate_version, App, AppSettings, Arg};23pub fn build_app() -> App<'static, 'static> {Small stylistic changesharkdpbefore adoptiona9c7696
line 4why, one step back4 let mut app = App::new("fd")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 5–9why, one step back5 .version(crate_version!())6 .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")7 .setting(AppSettings::ColoredHelp)8 .setting(AppSettings::DeriveDisplayOrder)9 .after_help(Inline the help textssharkdpbefore adoptione2a7d34
lines 10–11why, one step back10 "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \11 details.",Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 12–13why, one step back12 )13 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 14why, one step back14 Arg::with_name("hidden")Fix idempotent flagsDeepansh Soodbefore adoption2664998
lines 15–16why, one step back15 .long("hidden")16 .short("H")Inline the help textssharkdpbefore adoptione2a7d34
lines 17–23why, one step back17 .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 back24 )25 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 26why, one step back26 Arg::with_name("no-ignore")Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 27–28why, one step back27 .long("no-ignore")28 .short("I")Inline the help textssharkdpbefore adoptione2a7d34
lines 29–32why, one step back29 .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 \Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
line 33why, one step back33 ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file.",Inline the help textssharkdpbefore adoptione2a7d34
line 34why, one step back34 ),Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 35–36why, one step back35 )36 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 37why, one step back37 Arg::with_name("no-ignore-vcs")Fix CI errorDeepanshbefore adoptiona6ed0fc
line 38why, one step back38 .long("no-ignore-vcs")Inline the help textssharkdpbefore adoptione2a7d34
line 39why, one step back39 .overrides_with("no-ignore-vcs")Remove two options from short -h help textsharkdpbefore adoption1a96544
line 40why, one step back40 .hidden_short_help(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 41–44why, one step back41 .long_help(42 "Show search results from files and directories that would otherwise be \43 ignored by '.gitignore' files.",44 ),Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
lines 45–50why, one step back45 )46 .arg(47 Arg::with_name("no-global-ignore-file")48 .long("no-global-ignore-file")49 .hidden(true)50 .long_help("Do not respect the global ignore file."),Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 51–52why, one step back51 )52 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 53why, one step back53 Arg::with_name("rg-alias-hidden-ignore")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 54why, one step back54 .short("u")Expand help for `-u`, add to manpageNathan Henriebefore adoption59c27ba
line 55why, one step back55 .long("unrestricted")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 56why, one step back56 .multiple(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 57–61why, one step back57 .hidden_short_help(true)58 .long_help(59 "Alias for '--no-ignore'. Can be repeated. '-uu' is an alias for \60 '--no-ignore --hidden'.",61 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 62–63why, one step back62 )63 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 64why, one step back64 Arg::with_name("case-sensitive")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 65–66why, one step back65 .long("case-sensitive")66 .short("s")Inline the help textssharkdpbefore adoptione2a7d34
lines 67–73why, one step back67 .overrides_with_all(&["ignore-case", "case-sensitive"])68 .help("Case-sensitive search (default: smart case)")69 .long_help(70 "Perform a case-sensitive search. By default, fd uses case-insensitive \71 searches, unless the pattern contains an uppercase character (smart \72 case).",73 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 74–75why, one step back74 )75 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 76why, one step back76 Arg::with_name("ignore-case")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 77–78why, one step back77 .long("ignore-case")78 .short("i")Inline the help textssharkdpbefore adoptione2a7d34
lines 79–85why, one step back79 .overrides_with_all(&["case-sensitive", "ignore-case"])80 .help("Case-insensitive search (default: smart case)")81 .long_help(82 "Perform a case-insensitive search. By default, fd uses case-insensitive \83 searches, unless the pattern contains an uppercase character (smart \84 case).",85 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 86–87why, one step back86 )87 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 88why, one step back88 Arg::with_name("glob")Implement glob-based searchessharkdpbefore adoptiond5da615
lines 89–90why, one step back89 .long("glob")90 .short("g")Fix idempotent flagsDeepansh Soodbefore adoption2664998
line 91why, one step back91 .conflicts_with("fixed-strings")Inline the help textssharkdpbefore adoptione2a7d34
lines 92–94why, one step back92 .overrides_with("glob")93 .help("Glob-based search (default: regular expression)")94 .long_help("Perform a glob-based search instead of a regular expression search."),Implement glob-based searchessharkdpbefore adoptiond5da615
lines 95–96why, one step back95 )96 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 97why, one step back97 Arg::with_name("regex")Add --regex option to override --globsharkdpbefore adoptioneac20a8
line 98why, one step back98 .long("regex")Fix idempotent flagsDeepansh Soodbefore adoption2664998
line 99why, one step back99 .overrides_with_all(&["glob", "regex"])Inline the help textssharkdpbefore adoptione2a7d34
lines 100–104why, one step back100 .hidden_short_help(true)101 .long_help(102 "Perform a regular-expression based search (default). This can be used to \103 override --glob.",104 ),Add --regex option to override --globsharkdpbefore adoptioneac20a8
lines 105–106why, one step back105 )106 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 107why, one step back107 Arg::with_name("fixed-strings")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 108–109why, one step back108 .long("fixed-strings")109 .short("F")Fix idempotent flagsDeepansh Soodbefore adoption2664998
line 110why, one step back110 .alias("literal")Inline the help textssharkdpbefore adoptione2a7d34
line 111why, one step back111 .overrides_with("fixed-strings")Remove two options from short -h help textsharkdpbefore adoption1a96544
line 112why, one step back112 .hidden_short_help(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 113–115why, one step back113 .long_help(114 "Treat the pattern as a literal string instead of a regular expression.",115 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 116why, one step back116 )Fix CI errorDeepanshbefore adoptiona6ed0fc
line 117why, one step back117 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 118why, one step back118 Arg::with_name("absolute-path")Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 119–120why, one step back119 .long("absolute-path")120 .short("a")Inline the help textssharkdpbefore adoptione2a7d34
lines 121–125why, one step back121 .overrides_with("absolute-path")122 .help("Show absolute instead of relative paths")123 .long_help(124 "Shows the full path starting from the root as opposed to relative paths.",125 ),Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 126–127why, one step back126 )127 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 128why, one step back128 Arg::with_name("list-details")Rename --list to --list-detailssharkdpbefore adoptionc9dc617
line 129why, one step back129 .long("list-details")Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12
line 130why, one step back130 .short("l")Inline the help textssharkdpbefore adoptione2a7d34
line 131why, one step back131 .conflicts_with("absolute-path")Adapt --list-details help messagesharkdpbefore adoption2cfb1a2
line 132why, one step back132 .help("Use a long listing format with file metadata")Inline the help textssharkdpbefore adoptione2a7d34
lines 133–138why, one step back133 .long_help(134 "Use a detailed listing format like 'ls -l'. This is basically an alias \135 for '--exec-batch ls -l' with some additional 'ls' options. This can be \136 used to see more metadata, to show symlink targets and to achieve a \137 deterministic sort order.",138 ),Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12
lines 139–140why, one step back139 )140 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 141why, one step back141 Arg::with_name("follow")Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 142–144why, one step back142 .long("follow")143 .short("L")144 .alias("dereference")Inline the help textssharkdpbefore adoptione2a7d34
lines 145–150why, one step back145 .overrides_with("follow")146 .help("Follow symbolic links")147 .long_help(148 "By default, fd does not descend into symlinked directories. Using this \149 flag, symbolic links are also traversed.",150 ),Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 151–152why, one step back151 )152 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 153why, one step back153 Arg::with_name("full-path")Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 154–155why, one step back154 .long("full-path")155 .short("p")Inline the help textssharkdpbefore adoptione2a7d34
lines 156–162why, one step back156 .overrides_with("full-path")157 .help("Search full path (default: file-/dirname only)")158 .long_help(159 "By default, the search pattern is only matched against the filename (or \160 directory name). Using this flag, the pattern is matched against the \161 full path.",162 ),Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 163–164why, one step back163 )164 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 165why, one step back165 Arg::with_name("null_separator")Fix CI errorDeepanshbefore adoptiona6ed0fc
lines 166–167why, one step back166 .long("print0")167 .short("0")Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12
line 168why, one step back168 .overrides_with("print0")Inline the help textssharkdpbefore adoptione2a7d34
lines 169–174why, one step back169 .conflicts_with("list-details")170 .help("Separate results by the null character")171 .long_help(172 "Separate search results by the null character (instead of newlines). \173 Useful for piping results to 'xargs'.",174 ),Fix CI errorDeepanshbefore adoptiona6ed0fc
line 175why, one step back175 )Inline the help textssharkdpbefore adoptione2a7d34
line 176why, one step back176 .arg(Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b
line 177why, one step back177 Arg::with_name("max-depth")Inline the help textssharkdpbefore adoptione2a7d34
lines 178–180why, one step back178 .long("max-depth")179 .short("d")180 .takes_value(true)Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b
line 181why, one step back181 .value_name("depth")Inline the help textssharkdpbefore adoptione2a7d34
lines 182–187why, one step back182 .help("Set maximum search depth (default: none)")183 .long_help(184 "Limit the directory traversal to a given depth. By default, there is no \185 limit on the search depth.",186 ),187 )Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 188–189why, one step back188 // support --maxdepth as well, for compatibility with rg189 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 190why, one step back190 Arg::with_name("rg-depth")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 191–192why, one step back191 .long("maxdepth")192 .hidden(true)Inline the help textssharkdpbefore adoptione2a7d34
line 193why, one step back193 .takes_value(true)Add --min-depth and --exact-depthsharkdpbefore adoptiond63c63b
lines 194–216why, one step back194 )195 .arg(196 Arg::with_name("min-depth")197 .long("min-depth")198 .takes_value(true)199 .value_name("depth")200 .hidden_short_help(true)201 .long_help(202 "Only show search results starting at the given depth. \203 See also: '--max-depth' and '--exact-depth'",204 ),205 )206 .arg(207 Arg::with_name("exact-depth")208 .long("exact-depth")209 .takes_value(true)210 .value_name("depth")211 .hidden_short_help(true)212 .conflicts_with_all(&["max-depth", "min-depth"])213 .long_help(214 "Only show search results at the exact given depth. This is an alias for \215 '--min-depth <depth> --max-depth <depth>'.",216 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 217–218why, one step back217 )218 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 219why, one step back219 Arg::with_name("file-type")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 220–236why, one step back220 .long("type")221 .short("t")222 .multiple(true)223 .number_of_values(1)224 .takes_value(true)225 .value_name("filetype")226 .possible_values(&[227 "f",228 "file",229 "d",230 "directory",231 "l",232 "symlink",233 "x",234 "executable",235 "e",236 "empty",Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add
lines 237–240why, one step back237 "s",238 "socket",239 "p",240 "pipe",Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 241why, one step back241 ])Inline the help textssharkdpbefore adoptione2a7d34
lines 242–244why, one step back242 .hide_possible_values(true)243 .help(244 "Filter by type: file (f), directory (d), symlink (l),\nexecutable (x), \Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add
line 245why, one step back245 empty (e), socket (s), pipe (p)",Inline the help textssharkdpbefore adoptione2a7d34
lines 246–252why, one step back246 )247 .long_help(248 "Filter the search by type (multiple allowable filetypes can be specified):\n \249 'f' or 'file': regular files\n \250 'd' or 'directory': directories\n \251 'l' or 'symlink': symbolic links\n \252 'x' or 'executable': executables\n \Add new `--type socket` and `--type pipe` filterssharkdpbefore adoptioncb56add
lines 253–255why, one step back253 'e' or 'empty': empty files or directories\n \254 's' or 'socket': socket\n \255 'p' or 'pipe': named pipe (FIFO)",Inline the help textssharkdpbefore adoptione2a7d34
line 256why, one step back256 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 257–258why, one step back257 )258 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 259why, one step back259 Arg::with_name("extension")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 260–264why, one step back260 .long("extension")261 .short("e")262 .multiple(true)263 .number_of_values(1)264 .takes_value(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 265–270why, one step back265 .value_name("ext")266 .help("Filter by file extension")267 .long_help(268 "(Additionally) filter search results by their file extension. Multiple \269 allowable file extensions can be specified.",270 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 271–272why, one step back271 )272 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 273why, one step back273 Arg::with_name("exec")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 274–278why, one step back274 .long("exec")275 .short("x")276 .min_values(1)277 .allow_hyphen_values(true)278 .value_terminator(";")Add `-l`/`--list` optionsharkdpbefore adoptionda5cd12
line 279why, one step back279 .value_name("cmd")Inline the help textssharkdpbefore adoptione2a7d34
lines 280–293why, one step back280 .conflicts_with("list-details")281 .help("Execute a command for each search result")282 .long_help(283 "Execute a command for each search result.\n\284 All arguments following --exec are taken to be arguments to the command until the \285 argument ';' is encountered.\n\286 Each occurrence of the following placeholders is substituted by a path derived from the \287 current search result before the command is executed:\n \288 '{}': path\n \289 '{/}': basename\n \290 '{//}': parent directory\n \291 '{.}': path without file extension\n \292 '{/.}': basename without file extension",293 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 294–295why, one step back294 )295 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 296why, one step back296 Arg::with_name("exec-batch")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 297–302why, one step back297 .long("exec-batch")298 .short("X")299 .min_values(1)300 .allow_hyphen_values(true)301 .value_terminator(";")302 .value_name("cmd")Inline the help textssharkdpbefore adoptione2a7d34
lines 303–316why, one step back303 .conflicts_with_all(&["exec", "list-details"])304 .help("Execute a command with all search results at once")305 .long_help(306 "Execute a command with all search results at once.\n\307 All arguments following --exec-batch are taken to be arguments to the command until the \308 argument ';' is encountered.\n\309 A single occurrence of the following placeholders is authorized and substituted by the paths derived from the \310 search results before the command is executed:\n \311 '{}': path\n \312 '{/}': basename\n \313 '{//}': parent directory\n \314 '{.}': path without file extension\n \315 '{/.}': basename without file extension",316 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 317–318why, one step back317 )318 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 319why, one step back319 Arg::with_name("exclude")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 320–324why, one step back320 .long("exclude")321 .short("E")322 .takes_value(true)323 .value_name("pattern")324 .number_of_values(1)Inline the help textssharkdpbefore adoptione2a7d34
lines 325–331why, one step back325 .multiple(true)326 .help("Exclude entries that match the given glob pattern")327 .long_help(328 "Exclude files/directories that match the given glob pattern. This \329 overrides any other ignore logic. Multiple exclude patterns can be \330 specified.",331 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 332–333why, one step back332 )333 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 334why, one step back334 Arg::with_name("ignore-file")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 335–339why, one step back335 .long("ignore-file")336 .takes_value(true)337 .value_name("path")338 .number_of_values(1)339 .multiple(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 340–344why, one step back340 .hidden_short_help(true)341 .long_help(342 "Add a custom ignore-file in '.gitignore' format. These files have a low \343 precedence.",344 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 345–346why, one step back345 )346 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 347why, one step back347 Arg::with_name("color")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 348–352why, one step back348 .long("color")349 .short("c")350 .takes_value(true)351 .value_name("when")352 .possible_values(&["never", "auto", "always"])Inline the help textssharkdpbefore adoptione2a7d34
lines 353–360why, one step back353 .hide_possible_values(true)354 .help("When to use colors: never, *auto*, always")355 .long_help(356 "Declare when to use color for the pattern match output:\n \357 'auto': show colors if the output goes to an interactive console (default)\n \358 'never': do not use colorized output\n \359 'always': always use colorized output",360 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 361–362why, one step back361 )362 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 363why, one step back363 Arg::with_name("threads")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 364–367why, one step back364 .long("threads")365 .short("j")366 .takes_value(true)367 .value_name("num")Inline the help textssharkdpbefore adoptione2a7d34
lines 368–372why, one step back368 .hidden_short_help(true)369 .long_help(370 "Set number of threads to use for searching & executing (default: number \371 of available CPU cores)",372 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 373–374why, one step back373 )374 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 375why, one step back375 Arg::with_name("size")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 376–380why, one step back376 .long("size")377 .short("S")378 .takes_value(true)379 .number_of_values(1)380 .allow_hyphen_values(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 381–388why, one step back381 .multiple(true)382 .help("Limit results based on the size of files.")383 .long_help(384 "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \385 '+': file size must be greater than or equal to this\n \386 '-': file size must be less than or equal to this\n \387 'NUM': The numeric size (e.g. 500)\n \388 'UNIT': The units for NUM. They are not case-sensitive.\n\Update --size documentationsharkdpbefore adoptione3c77ef
lines 389–397why, one step back389 Allowed unit values:\n \390 'b': bytes\n \391 'k': kilobytes (base ten, 10^3 = 1000 bytes)\n \392 'm': megabytes\n \393 'g': gigabytes\n \394 't': terabytes\n \395 'ki': kibibytes (base two, 2^10 = 1024 bytes)\n \396 'mi': mebibytes\n \397 'gi': gibibytes\n \Inline the help textssharkdpbefore adoptione2a7d34
lines 398–399why, one step back398 'ti': tebibytes",399 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 400–401why, one step back400 )401 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 402why, one step back402 Arg::with_name("max-buffer-time")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 403–404why, one step back403 .long("max-buffer-time")404 .takes_value(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 405–409why, one step back405 .hidden(true)406 .long_help(407 "Amount of time in milliseconds to buffer, before streaming the search \408 results to the console.",409 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 410–411why, one step back410 )411 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 412why, one step back412 Arg::with_name("changed-within")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 413–414why, one step back413 .long("changed-within")414 .alias("change-newer-than")improve time option usage (#645)gorogoroumarubefore adoption74c3431
line 415why, one step back415 .alias("newer")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 416–417why, one step back416 .takes_value(true)417 .value_name("date|dur")Inline the help textssharkdpbefore adoptione2a7d34
lines 418–427why, one step back418 .number_of_values(1)419 .help("Filter by file modification time (newer than)")420 .long_help(421 "Filter results based on the file modification time. The argument can be provided \422 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \423 '--change-newer-than' can be used as an alias.\n\424 Examples:\n \425 --changed-within 2weeks\n \426 --change-newer-than '2018-10-27 10:00:00'",427 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 428–429why, one step back428 )429 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 430why, one step back430 Arg::with_name("changed-before")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 431–432why, one step back431 .long("changed-before")432 .alias("change-older-than")improve time option usage (#645)gorogoroumarubefore adoption74c3431
line 433why, one step back433 .alias("older")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 434–435why, one step back434 .takes_value(true)435 .value_name("date|dur")Inline the help textssharkdpbefore adoptione2a7d34
lines 436–445why, one step back436 .number_of_values(1)437 .help("Filter by file modification time (older than)")438 .long_help(439 "Filter results based on the file modification time. The argument can be provided \440 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \441 '--change-older-than' can be used as an alias.\n\442 Examples:\n \443 --changed-before '2018-10-27 10:00:00'\n \444 --change-older-than 2weeks",445 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 446–447why, one step back446 )447 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 448why, one step back448 Arg::with_name("max-results")Add --max-results=<count> optionsharkdpbefore adoptiond43827f
lines 449–451why, one step back449 .long("max-results")450 .takes_value(true)451 .value_name("count")Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3
lines 452–457why, one step back452 // We currently do not support --max-results in combination with453 // program execution because the results that come up in a --max-results454 // search are non-deterministic. Users might think that they can run the455 // same search with `--exec rm` attached and get a reliable removal of456 // the files they saw in the previous search.457 .conflicts_with_all(&["exec", "exec-batch", "list-details"])Inline the help textssharkdpbefore adoptione2a7d34
lines 458–459why, one step back458 .hidden_short_help(true)459 .long_help("Limit the number of search results to 'count' and quit immediately."),Add --max-results=<count> optionsharkdpbefore adoptiond43827f
lines 460–461why, one step back460 )461 .arg(Add alias -1 for --max-results=1Danny Möschbefore adoption2bab4a2
lines 462–465why, one step back462 Arg::with_name("max-one-result")463 .short("1")464 .hidden_short_help(true)465 .overrides_with("max-results")Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3
line 466why, one step back466 .conflicts_with_all(&["exec", "exec-batch", "list-details"])Add alias -1 for --max-results=1Danny Möschbefore adoption2bab4a2
lines 467–470why, one step back467 .long_help("Limit the search to a single result and quit immediately. \468 This is an alias for '--max-results=1'.")469 )470 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 471why, one step back471 Arg::with_name("show-errors")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 472why, one step back472 .long("show-errors")Fix idempotent flagsDeepansh Soodbefore adoption2664998
line 473why, one step back473 .hidden_short_help(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 474–478why, one step back474 .overrides_with("show-errors")475 .long_help(476 "Enable the display of filesystem errors for situations such as \477 insufficient permissions or dead symlinks.",478 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 479why, one step back479 )Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5
line 480why, one step back480 .arg(Inline the help textssharkdpbefore adoptione2a7d34
line 481why, one step back481 Arg::with_name("base-directory")Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5
lines 482–485why, one step back482 .long("base-directory")483 .takes_value(true)484 .value_name("path")485 .number_of_values(1)Inline the help textssharkdpbefore adoptione2a7d34
lines 486–493why, one step back486 .hidden_short_help(true)487 .long_help(488 "Change the current working directory of fd to the provided path. The \489 means that search results will be shown with respect to the given base \490 path. Note that relative paths which are passed to fd via the positional \491 <path> argument or the '--search-path' option will also be resolved \492 relative to this directory.",493 ),Allow changing current working directory of fdRafał Hajdackibefore adoptionfb205f5
line 494why, one step back494 )Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 495why, one step back495 .arg(Inline the help textssharkdpbefore adoptione2a7d34
lines 496–501why, one step back496 Arg::with_name("pattern").help(497 "the search pattern - a regular expression unless '--glob' is used (optional)",498 ),499 )500 .arg(501 Arg::with_name("path-separator")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 502–504why, one step back502 .takes_value(true)503 .value_name("separator")504 .long("path-separator")Inline the help textssharkdpbefore adoptione2a7d34
lines 505–509why, one step back505 .hidden_short_help(true)506 .long_help(507 "Set the path separator to use when printing file paths. The default is \508 the OS-specific separator ('/' on Unix, '\\' on Windows).",509 ),Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 510–511why, one step back510 )511 .arg(Inline the help textssharkdpbefore adoptione2a7d34
lines 512–521why, one step back512 Arg::with_name("path")513 .multiple(true)514 .help("the root directory for the filesystem search (optional)")515 .long_help(516 "The directory where the filesystem search is rooted (optional). If \517 omitted, search the current working directory.",518 ),519 )520 .arg(521 Arg::with_name("search-path")Support FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
lines 522–526why, one step back522 .long("search-path")523 .takes_value(true)524 .conflicts_with("path")525 .multiple(true)526 .hidden_short_help(true)Inline the help textssharkdpbefore adoptione2a7d34
lines 527–532why, one step back527 .number_of_values(1)528 .long_help(529 "Provide paths to search as an alternative to the positional <path> \530 argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \531 --search-path <path2> [<pattern>]`",532 ),Restrict `--one-file-system` to supported systemsSimon Engmannbefore adoptiondea1fbe
lines 533–534why, one step back533 );534[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 535–539why, one step back535 if cfg!(unix) {536 app = app.arg(537 Arg::with_name("owner")538 .long("owner")539 .short("o")[ownership] add help text for --ownerAlexandru Macoveibefore adoption6a68ac8
lines 540–551why, one step back540 .takes_value(true)541 .value_name("user:group")542 .help("Filter by owning user and/or group")543 .long_help(544 "Filter files by their user and/or group. \545 Format: [(user|uid)][:(group|gid)]. Either side is optional. \546 Precede either side with a '!' to exclude files instead.\n\547 Examples:\n \548 --owner john\n \549 --owner :students\n \550 --owner '!john:students'",551 ),[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 552–554why, one step back552 );553 }554Restrict `--one-file-system` to supported systemsSimon Engmannbefore adoptiondea1fbe
lines 555–556why, one step back555 // Make `--one-file-system` available only on Unix and Windows platforms, as per the556 // restrictions on the corresponding option in the `ignore` crate.Add aliases for `--one-file-system`Simon Engmannbefore adoption6f7d108
line 557why, one step back557 // Provide aliases `mount` and `xdev` for people coming from `find`.Shorten `cfg!()` checksSimon Engmannbefore adoptioned6c184
line 558why, one step back558 if cfg!(any(unix, windows)) {Small stylistic changesharkdpbefore adoptiona9c7696
line 559why, one step back559 app = app.arg(Inline the help textssharkdpbefore adoptione2a7d34
line 560why, one step back560 Arg::with_name("one-file-system")Add aliases for `--one-file-system`Simon Engmannbefore adoption6f7d108
line 561why, one step back561 .long("one-file-system")Hide --one-file-system from the short help textsharkdpbefore adoptionc001dd4
line 562why, one step back562 .aliases(&["mount", "xdev"])Inline the help textssharkdpbefore adoptione2a7d34
lines 563–569why, one step back563 .hidden_short_help(true)564 .long_help(565 "By default, fd will traverse the file system tree as far as other options \566 dictate. With this flag, fd ensures that it does not descend into a \567 different file system than the one it started in. Comparable to the -mount \568 or -xdev filters of find(1).",569 ),Small stylistic changesharkdpbefore adoptiona9c7696
line 570why, one step back570 );Restrict `--one-file-system` to supported systemsSimon Engmannbefore adoptiondea1fbe
line 571why, one step back571 }Small stylistic changesharkdpbefore adoptiona9c7696
lines 572–573why, one step back572573 appSupport FILE_ATTRIBUTE_HIDDEN on Windows (#478)David Peterbefore adoption3599a30
line 574why, one step back574}