Use docstrings for long help in clap derive
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Thayne McCombs · committed by Thayne McCombs · parent 614e637 · Browse files · 1 file·+243 added−207 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+243 added−207 removed
- other:+243 added−207 removed
Provenance
- Commit
e98a6c6- Tree
08d0dda- Author
Thayne McCombs <astrothayne@gmail.com>- Committer
Thayne McCombs <astrothayne@gmail.com>- Parent
614e637
1 file changed+243 added−207 removed
modified:src/cli.rs+243 added-207 removed
27 unmodified lines28 group(ArgGroup::new("execs").args(&["exec", "exec_batch", "list_details"]).conflicts_with_all(&[29 "max_results", "has_results", "count"])),30 )]31 pub struct Opts {32- /// Search hidden files and directories32+ /// Include hidden directories and files in the search results (default:33+ /// hidden files and directories are skipped). Files and directories are34+ /// considered to be hidden if their name starts with a `.` sign (dot).35+ /// The flag can be overridden with --no-hidden.36 #[arg(37 long,38 short = 'H',36- long_help = "Include hidden directories and files in the search results (default: \37- hidden files and directories are skipped). Files and directories are \38- considered to be hidden if their name starts with a `.` sign (dot). \39- The flag can be overridden with --no-hidden."39+ help = "Search hidden files and directories",40+ long_help41 )]42 pub hidden: bool,43 44 /// Overrides --hidden45 #[arg(long, overrides_with = "hidden", hide = true, action = ArgAction::SetTrue)]46 no_hidden: (),47 47- /// Do not respect .(git|fd)ignore files48+ /// Show search results from files and directories that would otherwise be49+ /// ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file.50+ /// The flag can be overridden with --ignore.51 #[arg(52 long,53 short = 'I',51- long_help = "Show search results from files and directories that would otherwise be \52- ignored by '.gitignore', '.ignore', '.fdignore', or the global ignore file. \53- The flag can be overridden with --ignore."54+ help = "Do not respect .(git|fd)ignore files",55+ long_help56 )]57 pub no_ignore: bool,58 59 /// Overrides --no-ignore60 #[arg(long, overrides_with = "no_ignore", hide = true, action = ArgAction::SetTrue)]61 ignore: (),62 61- /// Do not respect .gitignore files63+ ///Show search results from files and directories that would otherwise be64+ /// ignored by '.gitignore' files. The flag can be overridden with --ignore-vcs.65 #[arg(66 long,67 hide_short_help = true,65- long_help = "Show search results from files and directories that would otherwise be \66- ignored by '.gitignore' files. The flag can be overridden with --ignore-vcs."68+ help = "Do not respect .gitignore files",69+ long_help70 )]71 pub no_ignore_vcs: bool,72 73 /// Overrides --no-ignore-vcs74 #[arg(long, overrides_with = "no_ignore_vcs", hide = true, action = ArgAction::SetTrue)]75 ignore_vcs: (),76 74- /// Do not respect .(git|fd)ignore files in parent directories77+ /// Show search results from files and directories that would otherwise be78+ /// ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories.79 #[arg(80 long,81 hide_short_help = true,78- long_help = "Show search results from files and directories that would otherwise be \79- ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories."82+ help = "Do not respect .(git|fd)ignore files in parent directories",83+ long_help84 )]85 pub no_ignore_parent: bool,86 87 /// Do not respect the global ignore file88 #[arg(long, hide = true)]89 pub no_global_ignore_file: bool,90 87- /// Unrestricted search, alias for '--no-ignore --hidden'91+ /// Perform an unrestricted search, including ignored and hidden files. This is92+ /// an alias for '--no-ignore --hidden'.93 #[arg(long = "unrestricted", short = 'u', overrides_with_all(&["ignore", "no_hidden"]), action(ArgAction::Count), hide_short_help = true,89- long_help = "Perform an unrestricted search, including ignored and hidden files. This is \90- an alias for '--no-ignore --hidden'."94+ help = "Unrestricted search, alias for '--no-ignore --hidden'",95+ long_help,96 )]97 rg_alias_hidden_ignore: u8,98 99 /// Case-sensitive search (default: smart case)6 unmodified lines106 case)."107 )]108 pub case_sensitive: bool,109 105- /// Case-insensitive search (default: smart case)110+ /// Perform a case-insensitive search. By default, fd uses case-insensitive111+ /// searches, unless the pattern contains an uppercase character (smart112+ /// case).113 #[arg(114 long,115 short = 'i',116 overrides_with("case_sensitive"),110- long_help = "Perform a case-insensitive search. By default, fd uses case-insensitive \111- searches, unless the pattern contains an uppercase character (smart \112- case)."117+ help = "Case-insensitive search (default: smart case)",118+ long_help119 )]120 pub ignore_case: bool,121 116- /// Glob-based search (default: regular expression)122+ /// Perform a glob-based search instead of a regular expression search.123 #[arg(124 long,125 short = 'g',126 conflicts_with("fixed_strings"),121- long_help = "Perform a glob-based search instead of a regular expression search."127+ help = "Glob-based search (default: regular expression)",128+ long_help129 )]130 pub glob: bool,131 125- /// Regular-expression based search (default)132+ /// Perform a regular-expression based search (default). This can be used to133+ /// override --glob.134 #[arg(135 long,136 overrides_with("glob"),137 hide_short_help = true,130- long_help = "Perform a regular-expression based search (default). This can be used to \131- override --glob."138+ help = "Regular-expression based search (default)",139+ long_help140 )]141 pub regex: bool,142 135- /// Treat pattern as literal string stead of regex143+ /// Treat the pattern as a literal string instead of a regular expression. Note144+ /// that this also performs substring comparison. If you want to match on an145+ /// exact filename, consider using '--glob'.146 #[arg(147 long,148 short = 'F',149 alias = "literal",150 hide_short_help = true,141- long_help = "Treat the pattern as a literal string instead of a regular expression. Note \142- that this also performs substring comparison. If you want to match on an \143- exact filename, consider using '--glob'."151+ help = "Treat pattern as literal string stead of regex",152+ long_help153 )]154 pub fixed_strings: bool,155 147- /// Additional search patterns that need to be matched156+ /// Add additional required search patterns, all of which must be matched. Multiple157+ /// additional patterns can be specified. The patterns are regular158+ /// expressions, unless '--glob' or '--fixed-strings' is used.159 #[arg(160 long = "and",161 value_name = "pattern",151- long_help = "Add additional required search patterns, all of which must be matched. Multiple \152- additional patterns can be specified. The patterns are regular expressions, \153- unless '--glob' or '--fixed-strings' is used.",162+ help = "Additional search patterns that need to be matched",163+ long_help,164 hide_short_help = true,165 allow_hyphen_values = true166 )]167 pub exprs: Option<Vec<String>>,168 159- /// Show absolute instead of relative paths169+ /// Shows the full path starting from the root as opposed to relative paths.170+ /// The flag can be overridden with --relative-path.171 #[arg(172 long,173 short = 'a',163- long_help = "Shows the full path starting from the root as opposed to relative paths. \164- The flag can be overridden with --relative-path."174+ help = "Show absolute instead of relative paths",175+ long_help176 )]177 pub absolute_path: bool,178 179 /// Overrides --absolute-path180 #[arg(long, overrides_with = "absolute_path", hide = true, action = ArgAction::SetTrue)]181 relative_path: (),182 172- /// Use a long listing format with file metadata183+ /// Use a detailed listing format like 'ls -l'. This is basically an alias184+ /// for '--exec-batch ls -l' with some additional 'ls' options. This can be185+ /// used to see more metadata, to show symlink targets and to achieve a186+ /// deterministic sort order.187 #[arg(188 long,189 short = 'l',190 conflicts_with("absolute_path"),177- long_help = "Use a detailed listing format like 'ls -l'. This is basically an alias \178- for '--exec-batch ls -l' with some additional 'ls' options. This can be \179- used to see more metadata, to show symlink targets and to achieve a \180- deterministic sort order."191+ help = "Use a long listing format with file metadata",192+ long_help193 )]194 pub list_details: bool,195 196 /// Follow symbolic links10 unmodified lines207 /// Overrides --follow208 #[arg(long, overrides_with = "follow", hide = true, action = ArgAction::SetTrue)]209 no_follow: (),210 199- /// Search full abs. path (default: filename only)211+ /// By default, the search pattern is only matched against the filename (or directory name). Using this flag, the pattern is matched against the full (absolute) path. Example:212+ /// fd --glob -p '**/.git/config'213 #[arg(214 long,215 short = 'p',203- long_help = "By default, the search pattern is only matched against the filename (or \204- directory name). Using this flag, the pattern is matched against the full \205- (absolute) path. Example:\n \206- fd --glob -p '**/.git/config'"216+ help = "Search full abs. path (default: filename only)",217+ long_help,218+ verbatim_doc_comment219 )]220 pub full_path: bool,221 210- /// Separate search results by the null character222+ /// Separate search results by the null character (instead of newlines).223+ /// Useful for piping results to 'xargs'.224 #[arg(225 long = "print0",226 short = '0',227 conflicts_with("list_details"),228 hide_short_help = true,216- long_help = "Separate search results by the null character (instead of newlines). \217- Useful for piping results to 'xargs'."229+ help = "Separate search results by the null character",230+ long_help231 )]232 pub null_separator: bool,233 221- /// Set maximum search depth (default: none)234+ /// Limit the directory traversal to a given depth. By default, there is no235+ /// limit on the search depth.236 #[arg(237 long,238 short = 'd',239 value_name = "depth",240 alias("maxdepth"),227- long_help = "Limit the directory traversal to a given depth. By default, there is no \228- limit on the search depth."241+ help = "Set maximum search depth (default: none)",242+ long_help243 )]244 max_depth: Option<usize>,245 246 /// Only show search results starting at the given depth.247+ /// See also: '--max-depth' and '--exact-depth'248 #[arg(249 long,250 value_name = "depth",251 hide_short_help = true,237- long_help = "Only show search results starting at the given depth. \238- See also: '--max-depth' and '--exact-depth'"252+ help = "Only show search results starting at the given depth.",253+ long_help254 )]255 min_depth: Option<usize>,256 242- /// Only show search results at the exact given depth257+ /// Only show search results at the exact given depth. This is an alias for258+ /// '--min-depth <depth> --max-depth <depth>'.259 #[arg(long, value_name = "depth", hide_short_help = true, conflicts_with_all(&["max_depth", "min_depth"]),244- long_help = "Only show search results at the exact given depth. This is an alias for \245- '--min-depth <depth> --max-depth <depth>'.",260+ help = "Only show search results at the exact given depth",261+ long_help,262 )]263 exact_depth: Option<usize>,264 249- /// Exclude entries that match the given glob pattern265+ /// Exclude files/directories that match the given glob pattern. This266+ /// overrides any other ignore logic. Multiple exclude patterns can be267+ /// specified.268+ ///269+ /// Examples:270+ /// {n} --exclude '*.pyc'271+ /// {n} --exclude node_modules272 #[arg(273 long,274 short = 'E',275 value_name = "pattern",254- long_help = "Exclude files/directories that match the given glob pattern. This \255- overrides any other ignore logic. Multiple exclude patterns can be \256- specified.\n\n\257- Examples:\n \258- --exclude '*.pyc'\n \259- --exclude node_modules"276+ help = "Exclude entries that match the given glob pattern",277+ long_help278 )]279 pub exclude: Vec<String>,280 281 /// Do not traverse into directories that match the search criteria. If282 /// you want to exclude specific directories, use the '--exclude=…' option.283 #[arg(long, hide_short_help = true, conflicts_with_all(&["size", "exact_depth"]),266- long_help = "Do not traverse into directories that match the search criteria. If \267- you want to exclude specific directories, use the '--exclude=…' option.",284+ long_help,285 )]286 pub prune: bool,287 271- /// Filter by type: file (f), directory (d), symlink (l),272- /// executable (x), empty (e), socket (s), pipe (p)288+ /// Filter the search by type:289+ /// {n} 'f' or 'file': regular files290+ /// {n} 'd' or 'directory': directories291+ /// {n} 'l' or 'symlink': symbolic links292+ /// {n} 's' or 'socket': socket293+ /// {n} 'p' or 'pipe': named pipe (FIFO)294+ /// {n}{n} 'x' or 'executable': executables295+ /// {n} 'e' or 'empty': empty files or directories296+ ///297+ /// This option can be specified more than once to include multiple file types.298+ /// Searching for '--type file --type symlink' will show both regular files as299+ /// well as symlinks. Note that the 'executable' and 'empty' filters work differently:300+ /// '--type executable' implies '--type file' by default. And '--type empty' searches301+ /// for empty files and directories, unless either '--type file' or '--type directory'302+ /// is specified in addition.303+ ///304+ /// Examples:305+ /// {n} - Only search for files:306+ /// {n} fd --type file …307+ /// {n} fd -tf …308+ /// {n} - Find both files and symlinks309+ /// {n} fd --type file --type symlink …310+ /// {n} fd -tf -tl …311+ /// {n} - Find executable files:312+ /// {n} fd --type executable313+ /// {n} fd -tx314+ /// {n} - Find empty files:315+ /// {n} fd --type empty --type file316+ /// {n} fd -te -tf317+ /// {n} - Find empty directories:318+ /// {n} fd --type empty --type directory319+ /// {n} fd -te -td320 #[arg(321 long = "type",322 short = 't',323 value_name = "filetype",324 hide_possible_values = true,325 value_enum,279- long_help = "Filter the search by type:\n \280- 'f' or 'file': regular files\n \281- 'd' or 'directory': directories\n \282- 'l' or 'symlink': symbolic links\n \283- 's' or 'socket': socket\n \284- 'p' or 'pipe': named pipe (FIFO)\n\n \285- 'x' or 'executable': executables\n \286- 'e' or 'empty': empty files or directories\n\n\287- This option can be specified more than once to include multiple file types. \288- Searching for '--type file --type symlink' will show both regular files as \289- well as symlinks. Note that the 'executable' and 'empty' filters work differently: \290- '--type executable' implies '--type file' by default. And '--type empty' searches \291- for empty files and directories, unless either '--type file' or '--type directory' \292- is specified in addition.\n\n\293- Examples:\n \294- - Only search for files:\n \295- fd --type file …\n \296- fd -tf …\n \297- - Find both files and symlinks\n \298- fd --type file --type symlink …\n \299- fd -tf -tl …\n \300- - Find executable files:\n \301- fd --type executable\n \302- fd -tx\n \303- - Find empty files:\n \304- fd --type empty --type file\n \305- fd -te -tf\n \306- - Find empty directories:\n \307- fd --type empty --type directory\n \308- fd -te -td"326+ help = "Filter by type: file (f), directory (d), symlink (l), \327+ executable (x), empty (e), socket (s), pipe (p)",328+ long_help329 )]330 pub filetype: Option<Vec<FileType>>,331 312- /// Filter by file extension332+ /// (Additionally) filter search results by their file extension. Multiple333+ /// allowable file extensions can be specified.334+ ///335+ /// If you want to search for files without extension,336+ /// you can use the regex '^[^.]+$' as a normal search pattern.337 #[arg(338 long = "extension",339 short = 'e',340 value_name = "ext",317- long_help = "(Additionally) filter search results by their file extension. Multiple \318- allowable file extensions can be specified.\n\319- If you want to search for files without extension, \320- you can use the regex '^[^.]+$' as a normal search pattern."341+ help = "Filter by file extension",342+ long_help343 )]344 pub extensions: Option<Vec<String>>,345 324- /// Limit results based on the size of files346+ /// Limit results based on the size of files using the format <+-><NUM><UNIT>.347+ /// '+': file size must be greater than or equal to this348+ /// '-': file size must be less than or equal to this349+ ///350+ /// If neither '+' nor '-' is specified, file size must be exactly equal to this.351+ /// 'NUM': The numeric size (e.g. 500)352+ /// 'UNIT': The units for NUM. They are not case-sensitive.353+ /// Allowed unit values:354+ /// 'b': bytes355+ /// 'k': kilobytes (base ten, 10^3 = 1000 bytes)356+ /// 'm': megabytes357+ /// 'g': gigabytes358+ /// 't': terabytes359+ /// 'ki': kibibytes (base two, 2^10 = 1024 bytes)360+ /// 'mi': mebibytes361+ /// 'gi': gibibytes362+ /// 'ti': tebibytes363 #[arg(long, short = 'S', value_parser = SizeFilter::from_string, allow_hyphen_values = true, verbatim_doc_comment, value_name = "size",326- long_help = "Limit results based on the size of files using the format <+-><NUM><UNIT>.\n \327- '+': file size must be greater than or equal to this\n \328- '-': file size must be less than or equal to this\n\329- If neither '+' nor '-' is specified, file size must be exactly equal to this.\n \330- 'NUM': The numeric size (e.g. 500)\n \331- 'UNIT': The units for NUM. They are not case-sensitive.\n\332- Allowed unit values:\n \333- 'b': bytes\n \334- 'k': kilobytes (base ten, 10^3 = 1000 bytes)\n \335- 'm': megabytes\n \336- 'g': gigabytes\n \337- 't': terabytes\n \338- 'ki': kibibytes (base two, 2^10 = 1024 bytes)\n \339- 'mi': mebibytes\n \340- 'gi': gibibytes\n \341- 'ti': tebibytes",364+ help = "Limit results based on the size of files",365+ long_help,366+ verbatim_doc_comment,367 )]368 pub size: Vec<SizeFilter>,369 345- /// Filter by file modification time (newer than)370+ /// Filter results based on the file modification time. Files with modification times371+ /// greater than the argument are returned. The argument can be provided372+ /// as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min).373+ /// If the time is not specified, it defaults to 00:00:00.374+ /// '--change-newer-than' or '--newer' can be used as aliases.375+ ///376+ /// Examples:377+ /// {n} --changed-within 2weeks378+ /// {n} --change-newer-than '2018-10-27 10:00:00'379+ /// {n} --newer 2018-10-27380 #[arg(381 long,382 alias("change-newer-than"),383 alias("newer"),384 alias("changed-after"),385 value_name = "date|dur",352- long_help = "Filter results based on the file modification time. \353- Files with modification times greater than the argument are returned. \354- The argument can be provided \355- as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \356- If the time is not specified, it defaults to 00:00:00. \357- '--change-newer-than' or '--newer' can be used as aliases.\n\358- Examples:\n \359- --changed-within 2weeks\n \360- --change-newer-than '2018-10-27 10:00:00'\n \361- --newer 2018-10-27"386+ help = "Filter by file modification time (newer than)",387+ long_help388 )]389 pub changed_within: Option<String>,390 365- /// Filter by file modification time (older than)391+ /// Filter results based on the file modification time. Files with modification times392+ /// less than the argument are returned. The argument can be provided393+ /// as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min).394+ /// '--change-older-than' or '--older' can be used as aliases.395+ ///396+ /// Examples:397+ /// {n} --changed-before '2018-10-27 10:00:00'398+ /// {n} --change-older-than 2weeks399+ /// {n} --older 2018-10-27400 #[arg(401 long,402 alias("change-older-than"),403 alias("older"),404 value_name = "date|dur",371- long_help = "Filter results based on the file modification time. \372- Files with modification times less than the argument are returned. \373- The argument can be provided \374- as a specific point in time (YYYY-MM-DD HH:MM:SS) or as a duration (10h, 1d, 35min). \375- '--change-older-than' or '--older' can be used as aliases.\n\376- Examples:\n \377- --changed-before '2018-10-27 10:00:00'\n \378- --change-older-than 2weeks\n \379- --older 2018-10-27"405+ help = "Filter by file modification time (older than)",406+ long_help407 )]408 pub changed_before: Option<String>,409 383- /// Filter by owning user and/or group410+ /// Filter files by their user and/or group.411+ /// Format: [(user|uid)][:(group|gid)]. Either side is optional.412+ /// Precede either side with a '!' to exclude files instead.413+ ///414+ /// Examples:415+ /// {n} --owner john416+ /// {n} --owner :students417+ /// {n} --owner '!john:students'418 #[cfg(unix)]419 #[arg(long, short = 'o', value_parser = OwnerFilter::from_string, value_name = "user:group",386- long_help = "Filter files by their user and/or group. \387- Format: [(user|uid)][:(group|gid)]. Either side is optional. \388- Precede either side with a '!' to exclude files instead.\n\389- Examples:\n \390- --owner john\n \391- --owner :students\n \392- --owner '!john:students'"420+ help = "Filter by owning user and/or group",421+ long_help,422 )]423 pub owner: Option<OwnerFilter>,424 425 #[command(flatten)]426 pub exec: Exec,427 399- /// Max number of arguments to run as a batch size with -X428+ /// Maximum number of arguments to pass to the command given with -X.429+ /// If the number of results is greater than the given size,430+ /// the command given with -X is run again with remaining arguments.431+ /// A batch size of zero means there is no limit (default), but note432+ /// that batching might still happen due to OS restrictions on the433+ /// maximum length of command lines.434 #[arg(435 long,436 value_name = "size",437 hide_short_help = true,438 requires("exec_batch"),439 value_parser = value_parser!(usize),440 default_value_t,407- long_help = "Maximum number of arguments to pass to the command given with -X. \408- If the number of results is greater than the given size, \409- the command given with -X is run again with remaining arguments. \410- A batch size of zero means there is no limit (default), but note \411- that batching might still happen due to OS restrictions on the \412- maximum length of command lines.",441+ help = "Max number of arguments to run as a batch size with -X",442+ long_help,443 )]444 pub batch_size: usize,445 416- /// Add a custom ignore-file in '.gitignore' format446+ /// Add a custom ignore-file in '.gitignore' format. These files have a low precedence.447 #[arg(448 long,449 value_name = "path",450 hide_short_help = true,421- long_help = "Add a custom ignore-file in '.gitignore' format. These files have a low precedence."451+ help = "Add a custom ignore-file in '.gitignore' format",452+ long_help453 )]454 pub ignore_file: Vec<PathBuf>,455 425- /// When to use colors456+ /// Declare when to use color for the pattern match output457 #[arg(458 long,459 short = 'c',460 value_enum,461 default_value_t = ColorWhen::Auto,462 value_name = "when",432- long_help = "Declare when to use color for the pattern match output",463+ help = "When to use colors",464+ long_help,465 )]466 pub color: ColorWhen,467 468 /// Set number of threads to use for searching & executing (default: number7 unmodified lines476 /// results to the console.477 #[arg(long, hide = true, value_parser = parse_millis)]478 pub max_buffer_time: Option<Duration>,479 448- /// Limit number of search results480+ ///Limit the number of search results to 'count' and quit immediately.481 #[arg(482 long,483 value_name = "count",484 hide_short_help = true,453- long_help = "Limit the number of search results to 'count' and quit immediately."485+ help = "Limit the number of search results",486+ long_help487 )]488 max_results: Option<usize>,489 457- /// Limit search to a single result490+ /// Limit the search to a single result and quit immediately.491+ /// This is an alias for '--max-results=1'.492 #[arg(493 short = '1',494 hide_short_help = true,495 overrides_with("max_results"),462- long_help = "Limit the search to a single result and quit immediately. \463- This is an alias for '--max-results=1'."496+ help = "Limit search to a single result",497+ long_help498 )]499 max_one_result: bool,500 467- /// Print nothing, exit code 0 if match found, 1 otherwise501+ /// When the flag is present, the program does not print anything and will502+ /// return with an exit code of 0 if there is at least one match. Otherwise, the503+ /// exit code will be 1.504+ /// '--has-results' can be used as an alias.505 #[arg(506 long,507 short = 'q',508 alias = "has-results",509 hide_short_help = true,510 conflicts_with("max_results"),474- long_help = "When the flag is present, the program does not print anything and will \475- return with an exit code of 0 if there is at least one match. Otherwise, the \476- exit code will be 1. \477- '--has-results' can be used as an alias."511+ help = "Print nothing, exit code 0 if match found, 1 otherwise",512+ long_help513 )]514 pub quiet: bool,515 481- /// Show filesystem errors516+ /// Enable the display of filesystem errors for situations such as517+ /// insufficient permissions or dead symlinks.518 #[arg(519 long,520 hide_short_help = true,485- long_help = "Enable the display of filesystem errors for situations such as \486- insufficient permissions or dead symlinks."521+ help = "Show filesystem errors",522+ long_help523 )]524 pub show_errors: bool,525 490- /// Change current working directory526+ /// Change the current working directory of fd to the provided path. This527+ /// means that search results will be shown with respect to the given base528+ /// path. Note that relative paths which are passed to fd via the positional529+ /// <path> argument or the '--search-path' option will also be resolved530+ /// relative to this directory.531 #[arg(532 long,533 value_name = "path",534 hide_short_help = true,495- long_help = "Change the current working directory of fd to the provided path. This \496- means that search results will be shown with respect to the given base \497- path. Note that relative paths which are passed to fd via the positional \498- <path> argument or the '--search-path' option will also be resolved \499- relative to this directory."535+ help = "Change current working directory",536+ long_help537 )]538 pub base_directory: Option<PathBuf>,539 503- /// the search pattern (a regular expression, unless '--glob' is used; optional)540+ /// the search pattern which is either a regular expression (default) or a glob541+ /// pattern (if --glob is used). If no pattern has been specified, every entry542+ /// is considered a match. If your pattern starts with a dash (-), make sure to543+ /// pass '--' first, or it will be considered as a flag (fd -- '-foo').544 #[arg(545 default_value = "",546 hide_default_value = true,547 value_name = "pattern",508- long_help = "the search pattern which is either a regular expression (default) or a glob \509- pattern (if --glob is used). If no pattern has been specified, every entry \510- is considered a match. If your pattern starts with a dash (-), make sure to \511- pass '--' first, or it will be considered as a flag (fd -- '-foo')."548+ help = "the search pattern (a regular expression, unless '--glob' is used; optional)",549+ long_help550 )]551 pub pattern: String,552 515- /// Set path separator when printing file paths553+ /// Set the path separator to use when printing file paths. The default is554+ /// the OS-specific separator ('/' on Unix, '\' on Windows).555 #[arg(556 long,557 value_name = "separator",558 hide_short_help = true,520- long_help = "Set the path separator to use when printing file paths. The default is \521- the OS-specific separator ('/' on Unix, '\\' on Windows)."559+ help = "Set path separator when printing file paths",560+ long_help561 )]562 pub path_separator: Option<String>,563 525- /// the root directories for the filesystem search (optional)564+ /// The directory where the filesystem search is rooted (optional). If565+ /// omitted, search the current working directory.566 #[arg(action = ArgAction::Append,567 value_name = "path",528- long_help = "The directory where the filesystem search is rooted (optional). If \529- omitted, search the current working directory.",568+ help = "the root directories for the filesystem search (optional)",569+ long_help,570 )]571 path: Vec<PathBuf>,572 533- /// Provides paths to search as an alternative to the positional <path> argument573+ /// Provide paths to search as an alternative to the positional <path>574+ /// argument. Changes the usage to `fd [OPTIONS] --search-path <path>575+ /// --search-path <path2> [<pattern>]`576 #[arg(577 long,578 conflicts_with("path"),579 value_name = "search-path",580 hide_short_help = true,539- long_help = "Provide paths to search as an alternative to the positional <path> \540- argument. Changes the usage to `fd [OPTIONS] --search-path <path> \541- --search-path <path2> [<pattern>]`"581+ help = "Provides paths to search as an alternative to the positional <path> argument",582+ long_help583 )]584 search_path: Vec<PathBuf>,585 586 /// By default, relative paths are prefixed with './' when -x/--exec,587 /// -X/--exec-batch, or -0/--print0 are given, to reduce the risk of a588 /// path starting with '-' being treated as a command line option. Use589 /// this flag to disable this behaviour.549- #[arg(long, conflicts_with_all(&["path", "search_path"]), hide_short_help = true,550- long_help = "By default, relative paths are prefixed with './' when -x/--exec, \551- -X/--exec-batch, or -0/--print0 are given, to reduce the risk of a \552- path starting with '-' being treated as a command line option. Use \553- this flag to disable this behaviour.",554- )]590+ #[arg(long, conflicts_with_all(&["path", "search_path"]), hide_short_help = true, long_help)]591 pub strip_cwd_prefix: bool,592 593+ /// By default, fd will traverse the file system tree as far as other options594+ /// dictate. With this flag, fd ensures that it does not descend into a595+ /// different file system than the one it started in. Comparable to the -mount596+ /// or -xdev filters of find(1).597 #[cfg(any(unix, windows))]558- #[arg(long, aliases(&["mount", "xdev"]), hide_short_help = true,559- long_help = "By default, fd will traverse the file system tree as far as other options \560- dictate. With this flag, fd ensures that it does not descend into a \561- different file system than the one it started in. Comparable to the -mount \562- or -xdev filters of find(1).")]598+ #[arg(long, aliases(&["mount", "xdev"]), hide_short_help = true, long_help)]599 pub one_file_system: bool,600 601 #[cfg(feature = "completions")]602 #[arg(long, hide = true, exclusive = true)]236 unmodified lines