Inline the help texts
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by sharkdp · committed by sharkdp · parent e42ddda · Browse files · 1 file·+301 added−293 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+301 added−293 removed
- other:+301 added−293 removed
Provenance
- Commit
e2a7d34- Tree
10f8928- Author
sharkdp <davidpeter@web.de>- Committer
sharkdp <davidpeter@web.de>- Parent
e42ddda
1 file changed+301 added−293 removed
modified:src/app.rs+301 added-293 removed
1-use std::collections::HashMap;2-1 use clap::{crate_version, App, AppSettings, Arg};2 5-struct Help {6- short: &'static str,7- long: &'static str,8-}9-10-macro_rules! doc {11- ($map:expr, $name:expr, $short:expr) => {12- doc!($map, $name, $short, $short)13- };14- ($map:expr, $name:expr, $short:expr, $long:expr) => {15- $map.insert(16- $name,17- Help {18- short: $short,19- long: concat!($long, "\n "),20- },21- );22- };23-}24-3 pub fn build_app() -> App<'static, 'static> {26- let helps = usage();27- let arg = |name| {28- Arg::with_name(name)29- .help(helps[name].short)30- .long_help(helps[name].long)31- };32-4 let mut app = App::new("fd")5 .version(crate_version!())6 .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")7 .setting(AppSettings::ColoredHelp)8 .setting(AppSettings::DeriveDisplayOrder)9 .after_help(39- "Note: `fd -h` prints a short and concise overview while `fd --help` \40- gives all details.",10+ "Note: `fd -h` prints a short and concise overview while `fd --help` gives all \11+ details.",12 )13 .arg(43- arg("hidden")14+ Arg::with_name("hidden")15 .long("hidden")16 .short("H")46- .overrides_with("hidden"),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+ ),24 )25 .arg(49- arg("no-ignore")26+ Arg::with_name("no-ignore")27 .long("no-ignore")28 .short("I")52- .overrides_with("no-ignore"),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+ ),35 )36 .arg(55- arg("no-ignore-vcs")37+ Arg::with_name("no-ignore-vcs")38 .long("no-ignore-vcs")57- .overrides_with("no-ignore-vcs"),39+ .overrides_with("no-ignore-vcs")40+ .help("Do not respect .gitignore files")41+ .long_help(42+ "Show search results from files and directories that would otherwise be \43+ ignored by '.gitignore' files.",44+ ),45 )46 .arg(60- arg("rg-alias-hidden-ignore")47+ Arg::with_name("rg-alias-hidden-ignore")48 .short("u")49 .long("unrestricted")50 .multiple(true)64- .hidden_short_help(true),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+ ),56 )57 .arg(67- arg("case-sensitive")58+ Arg::with_name("case-sensitive")59 .long("case-sensitive")60 .short("s")70- .overrides_with_all(&["ignore-case", "case-sensitive"]),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+ ),68 )69 .arg(73- arg("ignore-case")70+ Arg::with_name("ignore-case")71 .long("ignore-case")72 .short("i")76- .overrides_with_all(&["case-sensitive", "ignore-case"]),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+ ),80 )81 .arg(79- arg("glob")82+ Arg::with_name("glob")83 .long("glob")84 .short("g")85 .conflicts_with("fixed-strings")83- .overrides_with("glob"),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."),89 )90 .arg(86- arg("regex")91+ Arg::with_name("regex")92 .long("regex")93 .overrides_with_all(&["glob", "regex"])89- .hidden_short_help(true),94+ .hidden_short_help(true)95+ .help("Perform a regex-based search")96+ .long_help(97+ "Perform a regular-expression based search (default). This can be used to \98+ override --glob.",99+ ),100 )101 .arg(92- arg("fixed-strings")102+ Arg::with_name("fixed-strings")103 .long("fixed-strings")104 .short("F")105 .alias("literal")96- .overrides_with("fixed-strings"),106+ .overrides_with("fixed-strings")107+ .help("Treat the pattern as a literal string")108+ .long_help(109+ "Treat the pattern as a literal string instead of a regular expression.",110+ ),111 )112 .arg(99- arg("absolute-path")113+ Arg::with_name("absolute-path")114 .long("absolute-path")115 .short("a")102- .overrides_with("absolute-path"),116+ .overrides_with("absolute-path")117+ .help("Show absolute instead of relative paths")118+ .long_help(119+ "Shows the full path starting from the root as opposed to relative paths.",120+ ),121 )122 .arg(105- arg("list-details")123+ Arg::with_name("list-details")124 .long("list-details")125 .short("l")108- .conflicts_with("absolute-path"),126+ .conflicts_with("absolute-path")127+ .help("Show details like permissions, owner, size and modification time.")128+ .long_help(129+ "Use a detailed listing format like 'ls -l'. This is basically an alias \130+ for '--exec-batch ls -l' with some additional 'ls' options. This can be \131+ used to see more metadata, to show symlink targets and to achieve a \132+ deterministic sort order.",133+ ),134 )135 .arg(111- arg("follow")136+ Arg::with_name("follow")137 .long("follow")138 .short("L")139 .alias("dereference")115- .overrides_with("follow"),140+ .overrides_with("follow")141+ .help("Follow symbolic links")142+ .long_help(143+ "By default, fd does not descend into symlinked directories. Using this \144+ flag, symbolic links are also traversed.",145+ ),146 )147 .arg(118- arg("full-path")148+ Arg::with_name("full-path")149 .long("full-path")150 .short("p")121- .overrides_with("full-path"),151+ .overrides_with("full-path")152+ .help("Search full path (default: file-/dirname only)")153+ .long_help(154+ "By default, the search pattern is only matched against the filename (or \155+ directory name). Using this flag, the pattern is matched against the \156+ full path.",157+ ),158 )159 .arg(124- arg("null_separator")160+ Arg::with_name("null_separator")161 .long("print0")162 .short("0")163 .overrides_with("print0")128- .conflicts_with("list-details"),164+ .conflicts_with("list-details")165+ .help("Separate results by the null character")166+ .long_help(167+ "Separate search results by the null character (instead of newlines). \168+ Useful for piping results to 'xargs'.",169+ ),170 )130- .arg(arg("depth").long("max-depth").short("d").takes_value(true))171+ .arg(172+ Arg::with_name("depth")173+ .long("max-depth")174+ .short("d")175+ .takes_value(true)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+ )182 // support --maxdepth as well, for compatibility with rg183 .arg(133- arg("rg-depth")184+ Arg::with_name("rg-depth")185 .long("maxdepth")186 .hidden(true)136- .takes_value(true),187+ .takes_value(true)188+ .help("See --max-depth")189+ .long_help("See --max-depth"),190 )191 .arg(139- arg("file-type")192+ Arg::with_name("file-type")193 .long("type")194 .short("t")195 .multiple(true)196 .number_of_values(1)10 unmodified lines207 "executable",208 "e",209 "empty",210 ])158- .hide_possible_values(true),211+ .hide_possible_values(true)212+ .help(213+ "Filter by type: file (f), directory (d), symlink (l),\nexecutable (x), \214+ empty (e)",215+ )216+ .long_help(217+ "Filter the search by type (multiple allowable filetypes can be specified):\n \218+ 'f' or 'file': regular files\n \219+ 'd' or 'directory': directories\n \220+ 'l' or 'symlink': symbolic links\n \221+ 'x' or 'executable': executables\n \222+ 'e' or 'empty': empty files or directories",223+ ),224 )225 .arg(161- arg("extension")226+ Arg::with_name("extension")227 .long("extension")228 .short("e")229 .multiple(true)230 .number_of_values(1)231 .takes_value(true)167- .value_name("ext"),232+ .value_name("ext")233+ .help("Filter by file extension")234+ .long_help(235+ "(Additionally) filter search results by their file extension. Multiple \236+ allowable file extensions can be specified.",237+ ),238 )239 .arg(170- arg("exec")240+ Arg::with_name("exec")241 .long("exec")242 .short("x")243 .min_values(1)244 .allow_hyphen_values(true)245 .value_terminator(";")246 .value_name("cmd")177- .conflicts_with("list-details"),247+ .conflicts_with("list-details")248+ .help("Execute a command for each search result")249+ .long_help(250+ "Execute a command for each search result.\n\251+ All arguments following --exec are taken to be arguments to the command until the \252+ argument ';' is encountered.\n\253+ Each occurrence of the following placeholders is substituted by a path derived from the \254+ current search result before the command is executed:\n \255+ '{}': path\n \256+ '{/}': basename\n \257+ '{//}': parent directory\n \258+ '{.}': path without file extension\n \259+ '{/.}': basename without file extension",260+ ),261 )262 .arg(180- arg("exec-batch")263+ Arg::with_name("exec-batch")264 .long("exec-batch")265 .short("X")266 .min_values(1)267 .allow_hyphen_values(true)268 .value_terminator(";")269 .value_name("cmd")187- .conflicts_with_all(&["exec", "list-details"]),270+ .conflicts_with_all(&["exec", "list-details"])271+ .help("Execute a command with all search results at once")272+ .long_help(273+ "Execute a command with all search results at once.\n\274+ All arguments following --exec-batch are taken to be arguments to the command until the \275+ argument ';' is encountered.\n\276+ A single occurrence of the following placeholders is authorized and substituted by the paths derived from the \277+ search results before the command is executed:\n \278+ '{}': path\n \279+ '{/}': basename\n \280+ '{//}': parent directory\n \281+ '{.}': path without file extension\n \282+ '{/.}': basename without file extension",283+ ),284 )285 .arg(190- arg("exclude")286+ Arg::with_name("exclude")287 .long("exclude")288 .short("E")289 .takes_value(true)290 .value_name("pattern")291 .number_of_values(1)196- .multiple(true),292+ .multiple(true)293+ .help("Exclude entries that match the given glob pattern")294+ .long_help(295+ "Exclude files/directories that match the given glob pattern. This \296+ overrides any other ignore logic. Multiple exclude patterns can be \297+ specified.",298+ ),299 )300 .arg(199- arg("ignore-file")301+ Arg::with_name("ignore-file")302 .long("ignore-file")303 .takes_value(true)304 .value_name("path")305 .number_of_values(1)306 .multiple(true)205- .hidden_short_help(true),307+ .hidden_short_help(true)308+ .help("Add a custom ignore-file in .gitignore format")309+ .long_help(310+ "Add a custom ignore-file in '.gitignore' format. These files have a low \311+ precedence.",312+ ),313 )314 .arg(208- arg("color")315+ Arg::with_name("color")316 .long("color")317 .short("c")318 .takes_value(true)319 .value_name("when")320 .possible_values(&["never", "auto", "always"])214- .hide_possible_values(true),321+ .hide_possible_values(true)322+ .help("When to use colors: never, *auto*, always")323+ .long_help(324+ "Declare when to use color for the pattern match output:\n \325+ 'auto': show colors if the output goes to an interactive console (default)\n \326+ 'never': do not use colorized output\n \327+ 'always': always use colorized output",328+ ),329 )330 .arg(217- arg("threads")331+ Arg::with_name("threads")332 .long("threads")333 .short("j")334 .takes_value(true)335 .value_name("num")222- .hidden_short_help(true),336+ .hidden_short_help(true)337+ .help("Set number of threads to use for searching & executing")338+ .long_help(339+ "Set number of threads to use for searching & executing (default: number \340+ of available CPU cores)",341+ ),342 )343 .arg(225- arg("size")344+ Arg::with_name("size")345 .long("size")346 .short("S")347 .takes_value(true)348 .number_of_values(1)349 .allow_hyphen_values(true)231- .multiple(true),350+ .multiple(true)351+ .help("Limit results based on the size of files.")352+ .long_help(353+ "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \354+ '+': file size must be greater than or equal to this\n \355+ '-': file size must be less than or equal to this\n \356+ 'NUM': The numeric size (e.g. 500)\n \357+ 'UNIT': The units for NUM. They are not case-sensitive.\n\358+ Allowed unit values:\n \359+ 'b': bytes\n \360+ 'k': kilobytes\n \361+ 'm': megabytes\n \362+ 'g': gigabytes\n \363+ 't': terabytes\n \364+ 'ki': kibibytes\n \365+ 'mi': mebibytes\n \366+ 'gi': gibibytes\n \367+ 'ti': tebibytes",368+ ),369 )370 .arg(234- arg("max-buffer-time")371+ Arg::with_name("max-buffer-time")372 .long("max-buffer-time")373 .takes_value(true)237- .hidden(true),374+ .hidden(true)375+ .help("the time (in ms) to buffer, before streaming to the console")376+ .long_help(377+ "Amount of time in milliseconds to buffer, before streaming the search \378+ results to the console.",379+ ),380 )381 .arg(240- arg("changed-within")382+ Arg::with_name("changed-within")383 .long("changed-within")384 .alias("change-newer-than")385 .takes_value(true)386 .value_name("date|dur")245- .number_of_values(1),387+ .number_of_values(1)388+ .help("Filter by file modification time (newer than)")389+ .long_help(390+ "Filter results based on the file modification time. The argument can be provided \391+ as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \392+ '--change-newer-than' can be used as an alias.\n\393+ Examples:\n \394+ --changed-within 2weeks\n \395+ --change-newer-than '2018-10-27 10:00:00'",396+ ),397 )398 .arg(248- arg("changed-before")399+ Arg::with_name("changed-before")400 .long("changed-before")401 .alias("change-older-than")402 .takes_value(true)403 .value_name("date|dur")253- .number_of_values(1),404+ .number_of_values(1)405+ .help("Filter by file modification time (older than)")406+ .long_help(407+ "Filter results based on the file modification time. The argument can be provided \408+ as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \409+ '--change-older-than' can be used as an alias.\n\410+ Examples:\n \411+ --changed-before '2018-10-27 10:00:00'\n \412+ --change-older-than 2weeks",413+ ),414 )415 .arg(256- arg("max-results")416+ Arg::with_name("max-results")417 .long("max-results")418 .takes_value(true)419 .value_name("count")420 .conflicts_with_all(&["exec", "exec-batch"])261- .hidden_short_help(true),421+ .hidden_short_help(true)422+ .long_help("Limit the number of search results to 'count' and quit immediately."),423 )424 .arg(264- arg("show-errors")425+ Arg::with_name("show-errors")426 .long("show-errors")427 .hidden_short_help(true)267- .overrides_with("show-errors"),428+ .overrides_with("show-errors")429+ .help("Enable display of filesystem errors")430+ .long_help(431+ "Enable the display of filesystem errors for situations such as \432+ insufficient permissions or dead symlinks.",433+ ),434 )435 .arg(270- arg("base-directory")436+ Arg::with_name("base-directory")437 .long("base-directory")438 .takes_value(true)439 .value_name("path")440 .number_of_values(1)275- .hidden_short_help(true),441+ .hidden_short_help(true)442+ .long_help(443+ "Change the current working directory of fd to the provided path. The \444+ means that search results will be shown with respect to the given base \445+ path. Note that relative paths which are passed to fd via the positional \446+ <path> argument or the '--search-path' option will also be resolved \447+ relative to this directory.",448+ ),449 )277- .arg(arg("pattern"))450 .arg(451+ Arg::with_name("pattern").help(452+ "the search pattern - a regular expression unless '--glob' is used (optional)",453+ ),454+ )455+ .arg(279- arg("path-separator")456+ Arg::with_name("path-separator")457 .takes_value(true)458 .value_name("separator")459 .long("path-separator")283- .hidden_short_help(true),460+ .hidden_short_help(true)461+ .help("Set the path separator to use when printing file paths.")462+ .long_help(463+ "Set the path separator to use when printing file paths. The default is \464+ the OS-specific separator ('/' on Unix, '\\' on Windows).",465+ ),466 )285- .arg(arg("path").multiple(true))467 .arg(287- arg("search-path")468+ Arg::with_name("path")469+ .multiple(true)470+ .help("the root directory for the filesystem search (optional)")471+ .long_help(472+ "The directory where the filesystem search is rooted (optional). If \473+ omitted, search the current working directory.",474+ ),475+ )476+ .arg(477+ Arg::with_name("search-path")478 .long("search-path")479 .takes_value(true)480 .conflicts_with("path")481 .multiple(true)482 .hidden_short_help(true)293- .number_of_values(1),483+ .number_of_values(1)484+ .long_help(485+ "Provide paths to search as an alternative to the positional <path> \486+ argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \487+ --search-path <path2> [<pattern>]`",488+ ),489 );490 491 // Make `--one-file-system` available only on Unix and Windows platforms, as per the492 // restrictions on the corresponding option in the `ignore` crate.493 // Provide aliases `mount` and `xdev` for people coming from `find`.494 if cfg!(any(unix, windows)) {495 app = app.arg(301- arg("one-file-system")496+ Arg::with_name("one-file-system")497 .long("one-file-system")498 .aliases(&["mount", "xdev"])304- .hidden_short_help(true),499+ .hidden_short_help(true)500+ .long_help(501+ "By default, fd will traverse the file system tree as far as other options \502+ dictate. With this flag, fd ensures that it does not descend into a \503+ different file system than the one it started in. Comparable to the -mount \504+ or -xdev filters of find(1).",505+ ),506 );507 }508 509 app510 }310-311-#[rustfmt::skip]312-fn usage() -> HashMap<&'static str, Help> {313- let mut h = HashMap::new();314- doc!(h, "hidden"315- , "Search hidden files and directories"316- , "Include hidden directories and files in the search results (default: hidden files \317- and directories are skipped). Files and directories are considered to be hidden if \318- their name starts with a `.` sign (dot).");319- doc!(h, "no-ignore"320- , "Do not respect .(git|fd)ignore files"321- , "Show search results from files and directories that would otherwise be ignored by \322- '.gitignore', '.ignore' or '.fdignore' files.");323- doc!(h, "no-ignore-vcs"324- , "Do not respect .gitignore files"325- , "Show search results from files and directories that would otherwise be ignored by \326- '.gitignore' files.");327- doc!(h, "case-sensitive"328- , "Case-sensitive search (default: smart case)"329- , "Perform a case-sensitive search. By default, fd uses case-insensitive searches, \330- unless the pattern contains an uppercase character (smart case).");331- doc!(h, "ignore-case"332- , "Case-insensitive search (default: smart case)"333- , "Perform a case-insensitive search. By default, fd uses case-insensitive searches, \334- unless the pattern contains an uppercase character (smart case).");335- doc!(h, "glob"336- , "Glob-based search (default: regular expression)"337- , "Perform a glob-based search instead of a regular expression search.");338- doc!(h, "regex"339- , "Perform a regex-based search"340- , "Perform a regular-expression based search (default). This can be used to override --glob.");341- doc!(h, "fixed-strings"342- , "Treat the pattern as a literal string"343- , "Treat the pattern as a literal string instead of a regular expression.");344- doc!(h, "absolute-path"345- , "Show absolute instead of relative paths"346- , "Shows the full path starting from the root as opposed to relative paths.");347- doc!(h, "list-details"348- , "Show details like permissions, owner, size and modification time."349- , "Use a detailed listing format like 'ls -l'. This is basically an alias \350- for '--exec-batch ls -l' with some additional 'ls' options. This can be used \351- to see more metadata, to show symlink targets and to achieve a deterministic \352- sort order.");353- doc!(h, "path-separator"354- , "Set the path separator to use when printing file paths."355- , "Set the path separator to use when printing file paths. The default is the OS-specific \356- separator ('/' on Unix, '\\' on Windows).");357- doc!(h, "follow"358- , "Follow symbolic links"359- , "By default, fd does not descend into symlinked directories. Using this flag, symbolic \360- links are also traversed.");361- doc!(h, "full-path"362- , "Search full path (default: file-/dirname only)"363- , "By default, the search pattern is only matched against the filename (or directory \364- name). Using this flag, the pattern is matched against the full path.");365- doc!(h, "null_separator"366- , "Separate results by the null character"367- , "Separate search results by the null character (instead of newlines). Useful for \368- piping results to 'xargs'.");369- doc!(h, "depth"370- , "Set maximum search depth (default: none)"371- , "Limit the directory traversal to a given depth. By default, there is no limit \372- on the search depth.");373- doc!(h, "rg-depth"374- , "See --max-depth"375- , "See --max-depth");376- doc!(h, "file-type"377- , "Filter by type: file (f), directory (d), symlink (l),\nexecutable (x), empty (e)"378- , "Filter the search by type (multiple allowable filetypes can be specified):\n \379- 'f' or 'file': regular files\n \380- 'd' or 'directory': directories\n \381- 'l' or 'symlink': symbolic links\n \382- 'x' or 'executable': executables\n \383- 'e' or 'empty': empty files or directories");384- doc!(h, "extension"385- , "Filter by file extension"386- , "(Additionally) filter search results by their file extension. Multiple allowable file \387- extensions can be specified.");388- doc!(h, "exec"389- , "Execute a command for each search result"390- , "Execute a command for each search result.\n\391- All arguments following --exec are taken to be arguments to the command until the \392- argument ';' is encountered.\n\393- Each occurrence of the following placeholders is substituted by a path derived from the \394- current search result before the command is executed:\n \395- '{}': path\n \396- '{/}': basename\n \397- '{//}': parent directory\n \398- '{.}': path without file extension\n \399- '{/.}': basename without file extension");400- doc!(h, "exec-batch"401- , "Execute a command with all search results at once"402- , "Execute a command with all search results at once.\n\403- All arguments following --exec-batch are taken to be arguments to the command until the \404- argument ';' is encountered.\n\405- A single occurrence of the following placeholders is authorized and substituted by the paths derived from the \406- search results before the command is executed:\n \407- '{}': path\n \408- '{/}': basename\n \409- '{//}': parent directory\n \410- '{.}': path without file extension\n \411- '{/.}': basename without file extension");412- doc!(h, "exclude"413- , "Exclude entries that match the given glob pattern"414- , "Exclude files/directories that match the given glob pattern. This overrides any \415- other ignore logic. Multiple exclude patterns can be specified.");416- doc!(h, "ignore-file"417- , "Add a custom ignore-file in .gitignore format"418- , "Add a custom ignore-file in '.gitignore' format. These files have a low precedence.");419- doc!(h, "color"420- , "When to use colors: never, *auto*, always"421- , "Declare when to use color for the pattern match output:\n \422- 'auto': show colors if the output goes to an interactive console (default)\n \423- 'never': do not use colorized output\n \424- 'always': always use colorized output");425- doc!(h, "threads"426- , "Set number of threads to use for searching & executing"427- , "Set number of threads to use for searching & executing (default: number of available \428- CPU cores)");429- doc!(h, "max-buffer-time"430- , "the time (in ms) to buffer, before streaming to the console"431- , "Amount of time in milliseconds to buffer, before streaming the search results to \432- the console.");433- doc!(h, "pattern"434- , "the search pattern - a regular expression unless '--glob' is used (optional)");435- doc!(h, "path"436- , "the root directory for the filesystem search (optional)"437- , "The directory where the filesystem search is rooted (optional). \438- If omitted, search the current working directory.");439- doc!(h, "rg-alias-hidden-ignore"440- , ""441- , "Alias for '--no-ignore'. Can be repeated; '-uu' is an alias for '--no-ignore --hidden'.");442- doc!(h, "size"443- , "Limit results based on the size of files."444- , "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \445- '+': file size must be greater than or equal to this\n \446- '-': file size must be less than or equal to this\n \447- 'NUM': The numeric size (e.g. 500)\n \448- 'UNIT': The units for NUM. They are not case-sensitive.\n\449- Allowed unit values:\n \450- 'b': bytes\n \451- 'k': kilobytes\n \452- 'm': megabytes\n \453- 'g': gigabytes\n \454- 't': terabytes\n \455- 'ki': kibibytes\n \456- 'mi': mebibytes\n \457- 'gi': gibibytes\n \458- 'ti': tebibytes");459- doc!(h, "changed-within"460- , "Filter by file modification time (newer than)"461- , "Filter results based on the file modification time. The argument can be provided \462- as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \463- '--change-newer-than' can be used as an alias.\n\464- Examples:\n \465- --changed-within 2weeks\n \466- --change-newer-than '2018-10-27 10:00:00'");467- doc!(h, "changed-before"468- , "Filter by file modification time (older than)"469- , "Filter results based on the file modification time. The argument can be provided \470- as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \471- '--change-older-than' can be used as an alias.\n\472- Examples:\n \473- --changed-before '2018-10-27 10:00:00'\n \474- --change-older-than 2weeks");475- doc!(h, "max-results"476- , "(hidden)"477- , "Limit the number of search results to 'count' and quit immediately.");478- doc!(h, "show-errors"479- , "Enable display of filesystem errors"480- , "Enable the display of filesystem errors for situations such as insufficient permissions \481- or dead symlinks.");482- doc!(h, "search-path"483- , "(hidden)"484- , "Provide paths to search as an alternative to the positional <path> argument. \485- Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> --search-path <path2> [<pattern>]`");486- doc!(h, "base-directory"487- , "(hidden)"488- , "Change the current working directory of fd to the provided path. The means that search \489- results will be shown with respect to the given base path. Note that relative paths \490- which are passed to fd via the positional <path> argument or the '--search-path' option \491- will also be resolved relative to this directory.");492-493- if cfg!(any(unix, windows)) {494- doc!(h, "one-file-system"495- , "Don't cross file system boundaries"496- , "By default, fd will traverse the file system tree as far as other options dictate. \497- With this flag, fd ensures that it does not descend into a different file system \498- than the one it started in. Comparable to the -mount or -xdev filters of find(1).");499- }500-501- h502-}