app.rs
This file
Path
src/app.rs
760 lines · 33.2 KiB · Rust
Last changed by
Merge pull request #861 from jcaplan/no-strip/760David Peterbefore adoptionb211ded
History of this fileTake it
The walk stopped after 200 commits: lines older than 17fbc2d point at it.
Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 1–3why, one step back1use clap::{crate_version, App, AppSettings, Arg};23pub fn build_app() -> App<'static, 'static> {Run cargo fmtsharkdpbefore adoptionea48a96
lines 4–8why, one step back4 let clap_color_setting = if std::env::var_os("NO_COLOR").is_none() {5 AppSettings::ColoredHelp6 } else {7 AppSettings::ColorNever8 };Use NO_COLOR env variable check also for help screenxanonidbefore adoption2cd3de8
line 9why, one step back9Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 10–12why, one step back10 let mut app = App::new("fd")11 .version(crate_version!())12 .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")Use NO_COLOR env variable check also for help screenxanonidbefore adoption2cd3de8
line 13why, one step back13 .setting(clap_color_setting)Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 14–27why, one step back14 .setting(AppSettings::DeriveDisplayOrder)15 .after_help(16 "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \17 details.",18 )19 .arg(20 Arg::with_name("hidden")21 .long("hidden")22 .short("H")23 .overrides_with("hidden")24 .help("Search hidden files and directories")25 .long_help(26 "Include hidden directories and files in the search results (default: \27 hidden files and directories are skipped). Files and directories are \Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 28–29why, one step back28 considered to be hidden if their name starts with a `.` sign (dot). \29 The flag can be overridden with --no-hidden.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 30–32why, one step back30 ),31 )32 .arg(Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 33–41why, one step back33 Arg::with_name("no-hidden")34 .long("no-hidden")35 .overrides_with("hidden")36 .hidden(true)37 .long_help(38 "Overrides --hidden.",39 ),40 )41 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 42–48why, one step back42 Arg::with_name("no-ignore")43 .long("no-ignore")44 .short("I")45 .overrides_with("no-ignore")46 .help("Do not respect .(git|fd)ignore files")47 .long_help(48 "Show search results from files and directories that would otherwise be \Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 49–50why, one step back49 ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file. \50 The flag can be overridden with --ignore.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 51–53why, one step back51 ),52 )53 .arg(Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 54–62why, one step back54 Arg::with_name("ignore")55 .long("ignore")56 .overrides_with("no-ignore")57 .hidden(true)58 .long_help(59 "Overrides --no-ignore.",60 ),61 )62 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 63–65why, one step back63 Arg::with_name("no-ignore-vcs")64 .long("no-ignore-vcs")65 .overrides_with("no-ignore-vcs")Remove two options from short -h help textsharkdpbefore adoption1a96544
line 66why, one step back66 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 67why, one step back67 .help("Do not respect .gitignore files")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 68–69why, one step back68 .long_help(69 "Show search results from files and directories that would otherwise be \Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
line 70why, one step back70 ignored by '.gitignore' files. The flag can be overridden with --ignore-vcs.",Update CHANGELOGsharkdpbefore adoption17fbc2d
line 71why, one step back71 ),Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
lines 72–73why, one step back72 )73 .arg(Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 74–82why, one step back74 Arg::with_name("ignore-vcs")75 .long("ignore-vcs")76 .overrides_with("no-ignore-vcs")77 .hidden(true)78 .long_help(79 "Overrides --no-ignore-vcs.",80 ),81 )82 .arg(Merge pull request #817 from will459/add_no_ignore_parentTavian Barnesbefore adoption476d404
lines 83–86why, one step back83 Arg::with_name("no-ignore-parent")84 .long("no-ignore-parent")85 .overrides_with("no-ignore-parent")86 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 87why, one step back87 .help("Do not respect .(git|fd)ignore files in parent directories")Merge pull request #817 from will459/add_no_ignore_parentTavian Barnesbefore adoption476d404
lines 88–93why, one step back88 .long_help(89 "Show search results from files and directories that would otherwise be \90 ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories.",91 ),92 )93 .arg(Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
lines 94–96why, one step back94 Arg::with_name("no-global-ignore-file")95 .long("no-global-ignore-file")96 .hidden(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 97why, one step back97 .help("Do not respect the global ignore file")Add global fdignore supportBobbie Soedirgobefore adoption79d5a5b
line 98why, one step back98 .long_help("Do not respect the global ignore file."),Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 99–103why, one step back99 )100 .arg(101 Arg::with_name("rg-alias-hidden-ignore")102 .short("u")103 .long("unrestricted")Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
line 104why, one step back104 .overrides_with_all(&["ignore", "no-hidden"])Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 105–106why, one step back105 .multiple(true)106 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 107why, one step back107 .help("Alias for '--no-ignore', and '--hidden' when given twice")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 108–150why, one step back108 .long_help(109 "Alias for '--no-ignore'. Can be repeated. '-uu' is an alias for \110 '--no-ignore --hidden'.",111 ),112 )113 .arg(114 Arg::with_name("case-sensitive")115 .long("case-sensitive")116 .short("s")117 .overrides_with_all(&["ignore-case", "case-sensitive"])118 .help("Case-sensitive search (default: smart case)")119 .long_help(120 "Perform a case-sensitive search. By default, fd uses case-insensitive \121 searches, unless the pattern contains an uppercase character (smart \122 case).",123 ),124 )125 .arg(126 Arg::with_name("ignore-case")127 .long("ignore-case")128 .short("i")129 .overrides_with_all(&["case-sensitive", "ignore-case"])130 .help("Case-insensitive search (default: smart case)")131 .long_help(132 "Perform a case-insensitive search. By default, fd uses case-insensitive \133 searches, unless the pattern contains an uppercase character (smart \134 case).",135 ),136 )137 .arg(138 Arg::with_name("glob")139 .long("glob")140 .short("g")141 .conflicts_with("fixed-strings")142 .overrides_with("glob")143 .help("Glob-based search (default: regular expression)")144 .long_help("Perform a glob-based search instead of a regular expression search."),145 )146 .arg(147 Arg::with_name("regex")148 .long("regex")149 .overrides_with_all(&["glob", "regex"])150 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 151why, one step back151 .help("Regular-expression based search (default)")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 152–162why, one step back152 .long_help(153 "Perform a regular-expression based search (default). This can be used to \154 override --glob.",155 ),156 )157 .arg(158 Arg::with_name("fixed-strings")159 .long("fixed-strings")160 .short("F")161 .alias("literal")162 .overrides_with("fixed-strings")Remove two options from short -h help textsharkdpbefore adoption1a96544
line 163why, one step back163 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 164why, one step back164 .help("Treat pattern as literal string instead of regex")Update CHANGELOGsharkdpbefore adoption17fbc2d
line 165why, one step back165 .long_help(Improve --fixed-strings help text, closes #627sharkdpbefore adoption17bd256
lines 166–168why, one step back166 "Treat the pattern as a literal string instead of a regular expression. Note \167 that this also performs substring comparison. If you want to match on an \168 exact filename, consider using '--glob'.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 169–177why, one step back169 ),170 )171 .arg(172 Arg::with_name("absolute-path")173 .long("absolute-path")174 .short("a")175 .overrides_with("absolute-path")176 .help("Show absolute instead of relative paths")177 .long_help(Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 178–179why, one step back178 "Shows the full path starting from the root as opposed to relative paths. \179 The flag can be overridden with --relative-path.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 180–182why, one step back180 ),181 )182 .arg(Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 183–191why, one step back183 Arg::with_name("relative-path")184 .long("relative-path")185 .overrides_with("absolute-path")186 .hidden(true)187 .long_help(188 "Overrides --absolute-path.",189 ),190 )191 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 192–212why, one step back192 Arg::with_name("list-details")193 .long("list-details")194 .short("l")195 .conflicts_with("absolute-path")196 .help("Use a long listing format with file metadata")197 .long_help(198 "Use a detailed listing format like 'ls -l'. This is basically an alias \199 for '--exec-batch ls -l' with some additional 'ls' options. This can be \200 used to see more metadata, to show symlink targets and to achieve a \201 deterministic sort order.",202 ),203 )204 .arg(205 Arg::with_name("follow")206 .long("follow")207 .short("L")208 .alias("dereference")209 .overrides_with("follow")210 .help("Follow symbolic links")211 .long_help(212 "By default, fd does not descend into symlinked directories. Using this \Merge pull request #822 from Asha20/pr/opposing-optionsDavid Peterbefore adoptiona539181
lines 213–223why, one step back213 flag, symbolic links are also traversed. \214 Flag can be overriden with --no-follow.",215 ),216 )217 .arg(218 Arg::with_name("no-follow")219 .long("no-follow")220 .overrides_with("follow")221 .hidden(true)222 .long_help(223 "Overrides --follow.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 224–230why, one step back224 ),225 )226 .arg(227 Arg::with_name("full-path")228 .long("full-path")229 .short("p")230 .overrides_with("full-path")Improve --full-path documentation, closes #839David Peterbefore adoption21fd013
line 231why, one step back231 .help("Search full abs. path (default: filename only)")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 232–233why, one step back232 .long_help(233 "By default, the search pattern is only matched against the filename (or \Improve --full-path documentation, closes #839David Peterbefore adoption21fd013
lines 234–236why, one step back234 directory name). Using this flag, the pattern is matched against the full \235 (absolute) path. Example:\n \236 fd --glob -p '**/.git/config'",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 237–244why, one step back237 ),238 )239 .arg(240 Arg::with_name("null_separator")241 .long("print0")242 .short("0")243 .overrides_with("print0")244 .conflicts_with("list-details")Hide --print0 from the short help textDavid Peterbefore adoptioncf7dd43
line 245why, one step back245 .hidden_short_help(true)Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 246–269why, one step back246 .help("Separate results by the null character")247 .long_help(248 "Separate search results by the null character (instead of newlines). \249 Useful for piping results to 'xargs'.",250 ),251 )252 .arg(253 Arg::with_name("max-depth")254 .long("max-depth")255 .short("d")256 .takes_value(true)257 .value_name("depth")258 .help("Set maximum search depth (default: none)")259 .long_help(260 "Limit the directory traversal to a given depth. By default, there is no \261 limit on the search depth.",262 ),263 )264 // support --maxdepth as well, for compatibility with rg265 .arg(266 Arg::with_name("rg-depth")267 .long("maxdepth")268 .hidden(true)269 .takes_value(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 270why, one step back270 .help("Set maximum search depth (default: none)")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 271–277why, one step back271 )272 .arg(273 Arg::with_name("min-depth")274 .long("min-depth")275 .takes_value(true)276 .value_name("depth")277 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 278why, one step back278 .help("Only show results starting at given depth")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 279–290why, one step back279 .long_help(280 "Only show search results starting at the given depth. \281 See also: '--max-depth' and '--exact-depth'",282 ),283 )284 .arg(285 Arg::with_name("exact-depth")286 .long("exact-depth")287 .takes_value(true)288 .value_name("depth")289 .hidden_short_help(true)290 .conflicts_with_all(&["max-depth", "min-depth"])Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 291why, one step back291 .help("Only show results at exact given depth")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 292–297why, one step back292 .long_help(293 "Only show search results at the exact given depth. This is an alias for \294 '--min-depth <depth> --max-depth <depth>'.",295 ),296 )297 .arg(Add --prune flagMatthias Reitingerbefore adoptionec4cc98
lines 298–301why, one step back298 Arg::with_name("prune")299 .long("prune")300 .conflicts_with_all(&["size", "exact-depth"])301 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 302why, one step back302 .help("Do not traverse into matching directories")Add longer help text for --prune, closes #727David Peterbefore adoption2570fbd
lines 303–304why, one step back303 .long_help("Do not traverse into directories that match the search criteria. If \304 you want to exclude specific directories, use the '--exclude=…' option.")Add --prune flagMatthias Reitingerbefore adoptionec4cc98
lines 305–306why, one step back305 )306 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 307–335why, one step back307 Arg::with_name("file-type")308 .long("type")309 .short("t")310 .multiple(true)311 .number_of_values(1)312 .takes_value(true)313 .value_name("filetype")314 .possible_values(&[315 "f",316 "file",317 "d",318 "directory",319 "l",320 "symlink",321 "x",322 "executable",323 "e",324 "empty",325 "s",326 "socket",327 "p",328 "pipe",329 ])330 .hide_possible_values(true)331 .help(332 "Filter by type: file (f), directory (d), symlink (l),\nexecutable (x), \333 empty (e), socket (s), pipe (p)",334 )335 .long_help(Improve --type help textDavid Peterbefore adoption088e42d
line 336why, one step back336 "Filter the search by type:\n \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 337–340why, one step back337 'f' or 'file': regular files\n \338 'd' or 'directory': directories\n \339 'l' or 'symlink': symbolic links\n \340 's' or 'socket': socket\n \Improve --type help textDavid Peterbefore adoption088e42d
lines 341–365why, one step back341 'p' or 'pipe': named pipe (FIFO)\n\n \342 'x' or 'executable': executables\n \343 'e' or 'empty': empty files or directories\n\n\344 This option can be specified more than once to include multiple file types. \345 Searching for '--type file --type symlink' will show both regular files as \346 well as symlinks. Note that the 'executable' and 'empty' filters work differently: \347 '--type executable' implies '--type file' by default. And '--type empty' searches \348 for empty files and directories, unless either '--type file' or '--type directory' \349 is specified in addition.\n\n\350 Examples:\n \351 - Only search for files:\n \352 fd --type file …\n \353 fd -tf …\n \354 - Find both files and symlinks\n \355 fd --type file --type symlink …\n \356 fd -tf -tl …\n \357 - Find executable files:\n \358 fd --type executable\n \359 fd -tx\n \360 - Find empty files:\n \361 fd --type empty --type file\n \362 fd -te -tf\n \363 - Find empty directories:\n \364 fd --type empty --type directory\n \365 fd -te -td"Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 366–378why, one step back366 ),367 )368 .arg(369 Arg::with_name("extension")370 .long("extension")371 .short("e")372 .multiple(true)373 .number_of_values(1)374 .takes_value(true)375 .value_name("ext")376 .help("Filter by file extension")377 .long_help(378 "(Additionally) filter search results by their file extension. Multiple \Improve --extension help text, closes #673sharkdpbefore adoptiond2659de
lines 379–381why, one step back379 allowable file extensions can be specified.\n\380 If you want to search for files without extension, \381 you can use the regex '^[^.]+$' as a normal search pattern.",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 382–392why, one step back382 ),383 )384 .arg(385 Arg::with_name("exec")386 .long("exec")387 .short("x")388 .min_values(1)389 .allow_hyphen_values(true)390 .value_terminator(";")391 .value_name("cmd")392 .conflicts_with("list-details")Shorter help text for `--exec`David Peterbefore adoption85fb738
line 393why, one step back393 .help("Execute a command for each search result")Update CHANGELOGsharkdpbefore adoption17fbc2d
line 394why, one step back394 .long_help(Improve -x/-X help text and man page descriptionDavid Peterbefore adoptionb5344da
lines 395–399why, one step back395 "Execute a command for each search result in parallel (use --threads=1 for sequential command execution). \396 All positional arguments following --exec are considered to be arguments to the command - not to fd. \397 It is therefore recommended to place the '-x'/'--exec' option last.\n\398 The following placeholders are substituted before the command is executed:\n \399 '{}': path (of the current search result)\n \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 400–402why, one step back400 '{/}': basename\n \401 '{//}': parent directory\n \402 '{.}': path without file extension\n \Improve -x/-X help text and man page descriptionDavid Peterbefore adoptionb5344da
lines 403–412why, one step back403 '{/.}': basename without file extension\n\n\404 If no placeholder is present, an implicit \"{}\" at the end is assumed.\n\n\405 Examples:\n\n \406 - find all *.zip files and unzip them:\n\n \407 fd -e zip -x unzip\n\n \408 - find *.h and *.cpp files and run \"clang-format -i ..\" for each of them:\n\n \409 fd -e h -e cpp -x clang-format -i\n\n \410 - Convert all *.jpg files to *.png files:\n\n \411 fd -e jpg -x convert {} {.}.png\412 ",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 413–425why, one step back413 ),414 )415 .arg(416 Arg::with_name("exec-batch")417 .long("exec-batch")418 .short("X")419 .min_values(1)420 .allow_hyphen_values(true)421 .value_terminator(";")422 .value_name("cmd")423 .conflicts_with_all(&["exec", "list-details"])424 .help("Execute a command with all search results at once")425 .long_help(Improve -x/-X help text and man page descriptionDavid Peterbefore adoptionb5344da
lines 426–428why, one step back426 "Execute the given command once, with all search results as arguments.\n\427 One of the following placeholders is substituted before the command is executed:\n \428 '{}': path (of all search results)\n \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 429–431why, one step back429 '{/}': basename\n \430 '{//}': parent directory\n \431 '{.}': path without file extension\n \Improve -x/-X help text and man page descriptionDavid Peterbefore adoptionb5344da
lines 432–439why, one step back432 '{/.}': basename without file extension\n\n\433 If no placeholder is present, an implicit \"{}\" at the end is assumed.\n\n\434 Examples:\n\n \435 - Find all test_*.py files and open them in your favorite editor:\n\n \436 fd -g 'test_*.py' -X vim\n\n \437 - Find all *.rs files and count the lines with \"wc -l ...\":\n\n \438 fd -e rs -X wc -l\439 "Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 440–442why, one step back440 ),441 )442 .arg(Implement `--batch-size` (#866)Devon Hollowoodbefore adoption17dd2a6
lines 443–457why, one step back443 Arg::with_name("batch-size")444 .long("batch-size")445 .takes_value(true)446 .value_name("size")447 .hidden_short_help(true)448 .requires("exec-batch")449 .help("Max number of arguments to run as a batch with -X")450 .long_help(451 "Maximum number of arguments to pass to the command given with -X. \452 If the number of results is greater than the given size, \453 the command given with -X is run again with remaining arguments. \454 A batch size of zero means there is no limit.",455 ),456 )457 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 458–468why, one step back458 Arg::with_name("exclude")459 .long("exclude")460 .short("E")461 .takes_value(true)462 .value_name("pattern")463 .number_of_values(1)464 .multiple(true)465 .help("Exclude entries that match the given glob pattern")466 .long_help(467 "Exclude files/directories that match the given glob pattern. This \468 overrides any other ignore logic. Multiple exclude patterns can be \Improve --exclude help text, closes #661sharkdpbefore adoptiond205a7f
lines 469–472why, one step back469 specified.\n\n\470 Examples:\n \471 --exclude '*.pyc'\n \472 --exclude node_modules",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 473–482why, one step back473 ),474 )475 .arg(476 Arg::with_name("ignore-file")477 .long("ignore-file")478 .takes_value(true)479 .value_name("path")480 .number_of_values(1)481 .multiple(true)482 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 483why, one step back483 .help("Add custom ignore-file in '.gitignore' format")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 484–511why, one step back484 .long_help(485 "Add a custom ignore-file in '.gitignore' format. These files have a low \486 precedence.",487 ),488 )489 .arg(490 Arg::with_name("color")491 .long("color")492 .short("c")493 .takes_value(true)494 .value_name("when")495 .possible_values(&["never", "auto", "always"])496 .hide_possible_values(true)497 .help("When to use colors: never, *auto*, always")498 .long_help(499 "Declare when to use color for the pattern match output:\n \500 'auto': show colors if the output goes to an interactive console (default)\n \501 'never': do not use colorized output\n \502 'always': always use colorized output",503 ),504 )505 .arg(506 Arg::with_name("threads")507 .long("threads")508 .short("j")509 .takes_value(true)510 .value_name("num")511 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 512why, one step back512 .help("Set number of threads")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 513–525why, one step back513 .long_help(514 "Set number of threads to use for searching & executing (default: number \515 of available CPU cores)",516 ),517 )518 .arg(519 Arg::with_name("size")520 .long("size")521 .short("S")522 .takes_value(true)523 .number_of_values(1)524 .allow_hyphen_values(true)525 .multiple(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 526why, one step back526 .help("Limit results based on the size of files")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 527–529why, one step back527 .long_help(528 "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \529 '+': file size must be greater than or equal to this\n \Add exact size support to the --size filter (#669)Platon Pronkobefore adoptione97a1e9
lines 530–531why, one step back530 '-': file size must be less than or equal to this\n\531 If neither '+' nor '-' is specified, file size must be exactly equal to this.\n \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 532–533why, one step back532 'NUM': The numeric size (e.g. 500)\n \533 'UNIT': The units for NUM. They are not case-sensitive.\n\Update --size documentationsharkdpbefore adoptione3c77ef
lines 534–542why, one step back534 Allowed unit values:\n \535 'b': bytes\n \536 'k': kilobytes (base ten, 10^3 = 1000 bytes)\n \537 'm': megabytes\n \538 'g': gigabytes\n \539 't': terabytes\n \540 'ki': kibibytes (base two, 2^10 = 1024 bytes)\n \541 'mi': mebibytes\n \542 'gi': gibibytes\n \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 543–550why, one step back543 'ti': tebibytes",544 ),545 )546 .arg(547 Arg::with_name("max-buffer-time")548 .long("max-buffer-time")549 .takes_value(true)550 .hidden(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 551why, one step back551 .help("Milliseconds to buffer before streaming search results to console")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 552–560why, one step back552 .long_help(553 "Amount of time in milliseconds to buffer, before streaming the search \554 results to the console.",555 ),556 )557 .arg(558 Arg::with_name("changed-within")559 .long("changed-within")560 .alias("change-newer-than")improve time option usage (#645)gorogoroumarubefore adoption74c3431
line 561why, one step back561 .alias("newer")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 562–568why, one step back562 .takes_value(true)563 .value_name("date|dur")564 .number_of_values(1)565 .help("Filter by file modification time (newer than)")566 .long_help(567 "Filter results based on the file modification time. The argument can be provided \568 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \Issue 624 newer older help text (#733)Andrew Mitchellbefore adoptioncb385a4
lines 569–570why, one step back569 If the time is not specified, it defaults to 00:00:00. \570 '--change-newer-than' or '--newer' can be used as aliases.\n\Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 571–572why, one step back571 Examples:\n \572 --changed-within 2weeks\n \Issue 624 newer older help text (#733)Andrew Mitchellbefore adoptioncb385a4
lines 573–574why, one step back573 --change-newer-than '2018-10-27 10:00:00'\n \574 --newer 2018-10-27",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 575–580why, one step back575 ),576 )577 .arg(578 Arg::with_name("changed-before")579 .long("changed-before")580 .alias("change-older-than")improve time option usage (#645)gorogoroumarubefore adoption74c3431
line 581why, one step back581 .alias("older")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 582–588why, one step back582 .takes_value(true)583 .value_name("date|dur")584 .number_of_values(1)585 .help("Filter by file modification time (older than)")586 .long_help(587 "Filter results based on the file modification time. The argument can be provided \588 as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \Issue 624 newer older help text (#733)Andrew Mitchellbefore adoptioncb385a4
line 589why, one step back589 '--change-older-than' or '--older' can be used as aliases.\n\Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 590–591why, one step back590 Examples:\n \591 --changed-before '2018-10-27 10:00:00'\n \Issue 624 newer older help text (#733)Andrew Mitchellbefore adoptioncb385a4
lines 592–593why, one step back592 --change-older-than 2weeks\n \593 --older 2018-10-27",Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 594–600why, one step back594 ),595 )596 .arg(597 Arg::with_name("max-results")598 .long("max-results")599 .takes_value(true)600 .value_name("count")Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3
lines 601–606why, one step back601 // We currently do not support --max-results in combination with602 // program execution because the results that come up in a --max-results603 // search are non-deterministic. Users might think that they can run the604 // same search with `--exec rm` attached and get a reliable removal of605 // the files they saw in the previous search.606 .conflicts_with_all(&["exec", "exec-batch", "list-details"])Update CHANGELOGsharkdpbefore adoption17fbc2d
line 607why, one step back607 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 608why, one step back608 .help("Limit number of search results")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 609–615why, one step back609 .long_help("Limit the number of search results to 'count' and quit immediately."),610 )611 .arg(612 Arg::with_name("max-one-result")613 .short("1")614 .hidden_short_help(true)615 .overrides_with("max-results")Do not allow list-details in combination with -1sharkdpbefore adoption0335cc3
line 616why, one step back616 .conflicts_with_all(&["exec", "exec-batch", "list-details"])Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 617why, one step back617 .help("Limit search to a single result")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 618–621why, one step back618 .long_help("Limit the search to a single result and quit immediately. \619 This is an alias for '--max-results=1'.")620 )621 .arg(Add -q/--quiet/--has-match flag (#813)Asha20before adoption334488c
lines 622–627why, one step back622 Arg::with_name("quiet")623 .long("quiet")624 .short("q")625 .alias("has-results")626 .hidden_short_help(true)627 .conflicts_with_all(&["exec", "exec-batch", "list-details", "max-results"])Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 628why, one step back628 .help("Print nothing, exit code 0 if match found, 1 otherwise")Add -q/--quiet/--has-match flag (#813)Asha20before adoption334488c
lines 629–636why, one step back629 .long_help(630 "When the flag is present, the program does not print anything and will \631 return with an exit code of 0 if there is at least one match. Otherwise, the \632 exit code will be 1. \633 '--has-results' can be used as an alias."634 )635 )636 .arg(Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 637–640why, one step back637 Arg::with_name("show-errors")638 .long("show-errors")639 .hidden_short_help(true)640 .overrides_with("show-errors")Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 641why, one step back641 .help("Show filesystem errors")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 642–653why, one step back642 .long_help(643 "Enable the display of filesystem errors for situations such as \644 insufficient permissions or dead symlinks.",645 ),646 )647 .arg(648 Arg::with_name("base-directory")649 .long("base-directory")650 .takes_value(true)651 .value_name("path")652 .number_of_values(1)653 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 654why, one step back654 .help("Change current working directory")Update CHANGELOGsharkdpbefore adoption17fbc2d
line 655why, one step back655 .long_help(add --base-directory, --path-separator, and --search-path to the man pageAllen Wildbefore adoption99934ab
line 656why, one step back656 "Change the current working directory of fd to the provided path. This \Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 657–664why, one step back657 means that search results will be shown with respect to the given base \658 path. Note that relative paths which are passed to fd via the positional \659 <path> argument or the '--search-path' option will also be resolved \660 relative to this directory.",661 ),662 )663 .arg(664 Arg::with_name("pattern").help(Update --help text regarding pattern, closes #684sharkdpbefore adoptionecfd8ce
lines 665–670why, one step back665 "the search pattern (a regular expression, unless '--glob' is used; optional)",666 ).long_help(667 "the search pattern which is either a regular expression (default) or a glob \668 pattern (if --glob is used). If no pattern has been specified, every entry \669 is considered a match. If your pattern starts with a dash (-), make sure to \670 pass '--' first, or it will be considered as a flag (fd -- '-foo').")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 671–677why, one step back671 )672 .arg(673 Arg::with_name("path-separator")674 .takes_value(true)675 .value_name("separator")676 .long("path-separator")677 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 678why, one step back678 .help("Set path separator when printing file paths")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 679–700why, one step back679 .long_help(680 "Set the path separator to use when printing file paths. The default is \681 the OS-specific separator ('/' on Unix, '\\' on Windows).",682 ),683 )684 .arg(685 Arg::with_name("path")686 .multiple(true)687 .help("the root directory for the filesystem search (optional)")688 .long_help(689 "The directory where the filesystem search is rooted (optional). If \690 omitted, search the current working directory.",691 ),692 )693 .arg(694 Arg::with_name("search-path")695 .long("search-path")696 .takes_value(true)697 .conflicts_with("path")698 .multiple(true)699 .hidden_short_help(true)700 .number_of_values(1)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 701why, one step back701 .help("Provide paths to search as an alternative to the positional <path>")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 702–706why, one step back702 .long_help(703 "Provide paths to search as an alternative to the positional <path> \704 argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \705 --search-path <path2> [<pattern>]`",706 ),Merge pull request #861 from jcaplan/no-strip/760David Peterbefore adoptionb211ded
lines 707–717why, one step back707 )708 .arg(709 Arg::with_name("strip-cwd-prefix")710 .long("strip-cwd-prefix")711 .conflicts_with_all(&["path", "search-path"])712 .hidden_short_help(true)713 .help("strip './' prefix from non-tty outputs")714 .long_help(715 "By default, relative paths are prefixed with './' when the output goes to a non \716 interactive terminal (TTY). Use this flag to disable this behaviour."717 )Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 718–719why, one step back718 );719[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 720–724why, one step back720 if cfg!(unix) {721 app = app.arg(722 Arg::with_name("owner")723 .long("owner")724 .short("o")[ownership] add help text for --ownerAlexandru Macoveibefore adoption6a68ac8
lines 725–736why, one step back725 .takes_value(true)726 .value_name("user:group")727 .help("Filter by owning user and/or group")728 .long_help(729 "Filter files by their user and/or group. \730 Format: [(user|uid)][:(group|gid)]. Either side is optional. \731 Precede either side with a '!' to exclude files instead.\n\732 Examples:\n \733 --owner john\n \734 --owner :students\n \735 --owner '!john:students'",736 ),[ownership] add --owner arg parsing and storageAlexandru Macoveibefore adoption4f9a024
lines 737–739why, one step back737 );738 }739Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 740–748why, one step back740 // Make `--one-file-system` available only on Unix and Windows platforms, as per the741 // restrictions on the corresponding option in the `ignore` crate.742 // Provide aliases `mount` and `xdev` for people coming from `find`.743 if cfg!(any(unix, windows)) {744 app = app.arg(745 Arg::with_name("one-file-system")746 .long("one-file-system")747 .aliases(&["mount", "xdev"])748 .hidden_short_help(true)Merge pull request #857 from exploide/short-help-completionTavian Barnesbefore adoption04fac46
line 749why, one step back749 .help("Do not descend into a different file system")Update CHANGELOGsharkdpbefore adoption17fbc2d
lines 750–760why, one step back750 .long_help(751 "By default, fd will traverse the file system tree as far as other options \752 dictate. With this flag, fd ensures that it does not descend into a \753 different file system than the one it started in. Comparable to the -mount \754 or -xdev filters of find(1).",755 ),756 );757 }758759 app760}