Upgrade to clap 3.0
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This wasn't backwards compatible so required some more substantial changes.
authored by Thayne McCombs · committed by Thayne McCombs · parent ec38e23 · Browse files · 6 files·+223 added−170 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+223 added−170 removed
- tests:+15 added−8 removed
- other:+208 added−162 removed
Provenance
- Commit
43f276e- Tree
96774cd- Author
Thayne McCombs <astrothayne@gmail.com>- Committer
Thayne McCombs <astrothayne@gmail.com>- Parent
ec38e23
6 files changed+223 added−170 removed
modified:src/app.rs+130 added-120 removed
1-use clap::{crate_version, App, AppSettings, Arg};1+use clap::{crate_version, App, AppSettings, Arg, ColorChoice};2 3-pub fn build_app() -> App<'static, 'static> {4- let clap_color_setting = if std::env::var_os("NO_COLOR").is_none() {5- AppSettings::ColoredHelp3+pub fn build_app() -> App<'static> {4+ let clap_color_choice = if std::env::var_os("NO_COLOR").is_none() {5+ ColorChoice::Auto6 } else {7- AppSettings::ColorNever7+ ColorChoice::Never8 };9 10 let mut app = App::new("fd")11 .version(crate_version!())12- .usage("fd [FLAGS/OPTIONS] [<pattern>] [<path>...]")13- .setting(clap_color_setting)12+ .color(clap_color_choice)13 .setting(AppSettings::DeriveDisplayOrder)14+ .setting(AppSettings::DontCollapseArgsInUsage)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")20+ Arg::new("hidden")21 .long("hidden")22- .short("H")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: \2 unmodified lines29 The flag can be overridden with --no-hidden.",30 ),31 )32 .arg(33- Arg::with_name("no-hidden")33+ Arg::new("no-hidden")34 .long("no-hidden")35 .overrides_with("hidden")36- .hidden(true)36+ .hide(true)37 .long_help(38 "Overrides --hidden.",39 ),40 )41 .arg(42- Arg::with_name("no-ignore")42+ Arg::new("no-ignore")43 .long("no-ignore")44- .short("I")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 \1 unmodified line50 The flag can be overridden with --ignore.",51 ),52 )53 .arg(54- Arg::with_name("ignore")54+ Arg::new("ignore")55 .long("ignore")56 .overrides_with("no-ignore")57- .hidden(true)57+ .hide(true)58 .long_help(59 "Overrides --no-ignore.",60 ),61 )62 .arg(63- Arg::with_name("no-ignore-vcs")63+ Arg::new("no-ignore-vcs")64 .long("no-ignore-vcs")65 .overrides_with("no-ignore-vcs")66- .hidden_short_help(true)66+ .hide_short_help(true)67 .help("Do not respect .gitignore files")68 .long_help(69 "Show search results from files and directories that would otherwise be \70 ignored by '.gitignore' files. The flag can be overridden with --ignore-vcs.",71 ),72 )73 .arg(74- Arg::with_name("ignore-vcs")74+ Arg::new("ignore-vcs")75 .long("ignore-vcs")76 .overrides_with("no-ignore-vcs")77- .hidden(true)77+ .hide(true)78 .long_help(79 "Overrides --no-ignore-vcs.",80 ),81 )82 .arg(83- Arg::with_name("no-ignore-parent")83+ Arg::new("no-ignore-parent")84 .long("no-ignore-parent")85 .overrides_with("no-ignore-parent")86- .hidden_short_help(true)86+ .hide_short_help(true)87 .help("Do not respect .(git|fd)ignore files in parent directories")88 .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(94- Arg::with_name("no-global-ignore-file")94+ Arg::new("no-global-ignore-file")95 .long("no-global-ignore-file")96- .hidden(true)96+ .hide(true)97 .help("Do not respect the global ignore file")98 .long_help("Do not respect the global ignore file."),99 )100 .arg(101- Arg::with_name("rg-alias-hidden-ignore")102- .short("u")101+ Arg::new("rg-alias-hidden-ignore")102+ .short('u')103 .long("unrestricted")104 .overrides_with_all(&["ignore", "no-hidden"])105- .multiple(true)106- .hidden_short_help(true)105+ .multiple_occurrences(true)106+ .hide_short_help(true)107 .help("Alias for '--no-ignore', and '--hidden' when given twice")108 .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")114+ Arg::new("case-sensitive")115 .long("case-sensitive")116- .short("s")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 \1 unmodified line122 case).",123 ),124 )125 .arg(126- Arg::with_name("ignore-case")126+ Arg::new("ignore-case")127 .long("ignore-case")128- .short("i")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 \1 unmodified line134 case).",135 ),136 )137 .arg(138- Arg::with_name("glob")138+ Arg::new("glob")139 .long("glob")140- .short("g")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")147+ Arg::new("regex")148 .long("regex")149 .overrides_with_all(&["glob", "regex"])150- .hidden_short_help(true)150+ .hide_short_help(true)151 .help("Regular-expression based search (default)")152 .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")158+ Arg::new("fixed-strings")159 .long("fixed-strings")160- .short("F")160+ .short('F')161 .alias("literal")162 .overrides_with("fixed-strings")163- .hidden_short_help(true)163+ .hide_short_help(true)164 .help("Treat pattern as literal string instead of regex")165 .long_help(166 "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'.",169 ),170 )171 .arg(172- Arg::with_name("absolute-path")172+ Arg::new("absolute-path")173 .long("absolute-path")174- .short("a")174+ .short('a')175 .overrides_with("absolute-path")176 .help("Show absolute instead of relative paths")177 .long_help(178 "Shows the full path starting from the root as opposed to relative paths. \179 The flag can be overridden with --relative-path.",180 ),181 )182 .arg(183- Arg::with_name("relative-path")183+ Arg::new("relative-path")184 .long("relative-path")185 .overrides_with("absolute-path")186- .hidden(true)186+ .hide(true)187 .long_help(188 "Overrides --absolute-path.",189 ),190 )191 .arg(192- Arg::with_name("list-details")192+ Arg::new("list-details")193 .long("list-details")194- .short("l")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 \2 unmodified lines201 deterministic sort order.",202 ),203 )204 .arg(205- Arg::with_name("follow")205+ Arg::new("follow")206 .long("follow")207- .short("L")207+ .short('L')208 .alias("dereference")209 .overrides_with("follow")210 .help("Follow symbolic links")211 .long_help(2 unmodified lines214 Flag can be overriden with --no-follow.",215 ),216 )217 .arg(218- Arg::with_name("no-follow")218+ Arg::new("no-follow")219 .long("no-follow")220 .overrides_with("follow")221- .hidden(true)221+ .hide(true)222 .long_help(223 "Overrides --follow.",224 ),225 )226 .arg(227- Arg::with_name("full-path")227+ Arg::new("full-path")228 .long("full-path")229- .short("p")229+ .short('p')230 .overrides_with("full-path")231 .help("Search full abs. path (default: filename only)")232 .long_help(233 "By default, the search pattern is only matched against the filename (or \2 unmodified lines236 fd --glob -p '**/.git/config'",237 ),238 )239 .arg(240- Arg::with_name("null_separator")240+ Arg::new("null_separator")241 .long("print0")242- .short("0")242+ .short('0')243 .overrides_with("print0")244 .conflicts_with("list-details")245- .hidden_short_help(true)245+ .hide_short_help(true)246 .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")253+ Arg::new("max-depth")254 .long("max-depth")255- .short("d")255+ .short('d')256 .takes_value(true)257 .value_name("depth")258 .help("Set maximum search depth (default: none)")259 .long_help(2 unmodified lines262 ),263 )264 // support --maxdepth as well, for compatibility with rg265 .arg(266- Arg::with_name("rg-depth")266+ Arg::new("rg-depth")267 .long("maxdepth")268- .hidden(true)268+ .hide(true)269 .takes_value(true)270 .help("Set maximum search depth (default: none)")271 )272 .arg(273- Arg::with_name("min-depth")273+ Arg::new("min-depth")274 .long("min-depth")275 .takes_value(true)276 .value_name("depth")277- .hidden_short_help(true)277+ .hide_short_help(true)278 .help("Only show results starting at given depth")279 .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")285+ Arg::new("exact-depth")286 .long("exact-depth")287 .takes_value(true)288 .value_name("depth")289- .hidden_short_help(true)289+ .hide_short_help(true)290 .conflicts_with_all(&["max-depth", "min-depth"])291 .help("Only show results at exact given depth")292 .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(298- Arg::with_name("prune")298+ Arg::new("prune")299 .long("prune")300 .conflicts_with_all(&["size", "exact-depth"])301- .hidden_short_help(true)301+ .hide_short_help(true)302 .help("Do not traverse into matching directories")303 .long_help("Do not traverse into directories that match the search criteria. If \304 you want to exclude specific directories, use the '--exclude=…' option.")305 )306 .arg(307- Arg::with_name("file-type")307+ Arg::new("file-type")308 .long("type")309- .short("t")310- .multiple(true)309+ .short('t')310+ .multiple_occurrences(true)311 .number_of_values(1)312 .takes_value(true)313 .value_name("filetype")314 .possible_values(&[50 unmodified lines365 fd -te -td"366 ),367 )368 .arg(369- Arg::with_name("extension")369+ Arg::new("extension")370 .long("extension")371- .short("e")372- .multiple(true)371+ .short('e')372+ .multiple_occurrences(true)373 .number_of_values(1)374 .takes_value(true)375 .value_name("ext")376 .help("Filter by file extension")4 unmodified lines381 you can use the regex '^[^.]+$' as a normal search pattern.",382 ),383 )384 .arg(385- Arg::with_name("exec")385+ Arg::new("exec")386 .long("exec")387- .short("x")387+ .short('x')388 .min_values(1)389 .allow_hyphen_values(true)390 .value_terminator(";")391 .value_name("cmd")20 unmodified lines412 ",413 ),414 )415 .arg(416- Arg::with_name("exec-batch")416+ Arg::new("exec-batch")417 .long("exec-batch")418- .short("X")418+ .short('X')419 .min_values(1)420 .allow_hyphen_values(true)421 .value_terminator(";")422 .value_name("cmd")16 unmodified lines439 "440 ),441 )442 .arg(443- Arg::with_name("batch-size")443+ Arg::new("batch-size")444 .long("batch-size")445 .takes_value(true)446 .value_name("size")447- .hidden_short_help(true)447+ .hide_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. \2 unmodified lines454 A batch size of zero means there is no limit.",455 ),456 )457 .arg(458- Arg::with_name("exclude")458+ Arg::new("exclude")459 .long("exclude")460- .short("E")460+ .short('E')461 .takes_value(true)462 .value_name("pattern")463 .number_of_values(1)464- .multiple(true)464+ .multiple_occurrences(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 \3 unmodified lines472 --exclude node_modules",473 ),474 )475 .arg(476- Arg::with_name("ignore-file")476+ Arg::new("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)481+ .multiple_occurrences(true)482+ .hide_short_help(true)483 .help("Add custom ignore-file in '.gitignore' format")484 .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")490+ Arg::new("color")491 .long("color")492- .short("c")492+ .short('c')493 .takes_value(true)494 .value_name("when")495 .possible_values(&["never", "auto", "always"])496 .hide_possible_values(true)5 unmodified lines502 'always': always use colorized output",503 ),504 )505 .arg(506- Arg::with_name("threads")506+ Arg::new("threads")507 .long("threads")508- .short("j")508+ .short('j')509 .takes_value(true)510 .value_name("num")511- .hidden_short_help(true)511+ .hide_short_help(true)512 .help("Set number of threads")513 .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")519+ Arg::new("size")520 .long("size")521- .short("S")521+ .short('S')522 .takes_value(true)523 .number_of_values(1)524 .allow_hyphen_values(true)525- .multiple(true)525+ .multiple_occurrences(true)526 .help("Limit results based on the size of files")527 .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 \13 unmodified lines543 'ti': tebibytes",544 ),545 )546 .arg(547- Arg::with_name("max-buffer-time")547+ Arg::new("max-buffer-time")548 .long("max-buffer-time")549 .takes_value(true)550- .hidden(true)550+ .hide(true)551 .help("Milliseconds to buffer before streaming search results to console")552 .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")558+ Arg::new("changed-within")559 .long("changed-within")560 .alias("change-newer-than")561 .alias("newer")562 .takes_value(true)11 unmodified lines574 --newer 2018-10-27",575 ),576 )577 .arg(578- Arg::with_name("changed-before")578+ Arg::new("changed-before")579 .long("changed-before")580 .alias("change-older-than")581 .alias("older")582 .takes_value(true)10 unmodified lines593 --older 2018-10-27",594 ),595 )596 .arg(597- Arg::with_name("max-results")597+ Arg::new("max-results")598 .long("max-results")599 .takes_value(true)600 .value_name("count")601 // We currently do not support --max-results in combination with1 unmodified line603 // 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"])607- .hidden_short_help(true)607+ .hide_short_help(true)608 .help("Limit number of search results")609 .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)612+ Arg::new("max-one-result")613+ .short('1')614+ .hide_short_help(true)615 .overrides_with("max-results")616 .conflicts_with_all(&["exec", "exec-batch", "list-details"])617 .help("Limit search to a single result")618 .long_help("Limit the search to a single result and quit immediately. \619 This is an alias for '--max-results=1'.")620 )621 .arg(622- Arg::with_name("quiet")622+ Arg::new("quiet")623 .long("quiet")624- .short("q")624+ .short('q')625 .alias("has-results")626- .hidden_short_help(true)626+ .hide_short_help(true)627 .conflicts_with_all(&["exec", "exec-batch", "list-details", "max-results"])628 .help("Print nothing, exit code 0 if match found, 1 otherwise")629 .long_help(630 "When the flag is present, the program does not print anything and will \2 unmodified lines633 '--has-results' can be used as an alias."634 )635 )636 .arg(637- Arg::with_name("show-errors")637+ Arg::new("show-errors")638 .long("show-errors")639- .hidden_short_help(true)639+ .hide_short_help(true)640 .overrides_with("show-errors")641 .help("Show filesystem errors")642 .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")648+ Arg::new("base-directory")649 .long("base-directory")650 .takes_value(true)651 .value_name("path")652 .number_of_values(1)653+ .allow_invalid_utf8(true)653- .hidden_short_help(true)654+ .hide_short_help(true)655 .help("Change current working directory")656 .long_help(657 "Change the current working directory of fd to the provided path. This \658 means that search results will be shown with respect to the given base \2 unmodified lines661 relative to this directory.",662 ),663 )664 .arg(664- Arg::with_name("pattern").help(665+ Arg::new("pattern")666+ .allow_invalid_utf8(true)667+ .help(668 "the search pattern (a regular expression, unless '--glob' is used; optional)",669 ).long_help(670 "the search pattern which is either a regular expression (default) or a glob \671 pattern (if --glob is used). If no pattern has been specified, every entry \672 is considered a match. If your pattern starts with a dash (-), make sure to \673 pass '--' first, or it will be considered as a flag (fd -- '-foo').")674 )675 .arg(673- Arg::with_name("path-separator")676+ Arg::new("path-separator")677 .takes_value(true)678 .value_name("separator")679 .long("path-separator")677- .hidden_short_help(true)680+ .hide_short_help(true)681 .help("Set path separator when printing file paths")682 .long_help(683 "Set the path separator to use when printing file paths. The default is \684 the OS-specific separator ('/' on Unix, '\\' on Windows).",685 ),686 )687 .arg(685- Arg::with_name("path")686- .multiple(true)688+ Arg::new("path")689+ .multiple_occurrences(true)690+ .allow_invalid_utf8(true)691 .help("the root directory for the filesystem search (optional)")692 .long_help(693 "The directory where the filesystem search is rooted (optional). If \694 omitted, search the current working directory.",695 ),696 )697 .arg(694- Arg::with_name("search-path")698+ Arg::new("search-path")699 .long("search-path")700 .takes_value(true)701 .conflicts_with("path")698- .multiple(true)699- .hidden_short_help(true)702+ .multiple_occurrences(true)703+ .hide_short_help(true)704 .number_of_values(1)705+ .allow_invalid_utf8(true)706 .help("Provide paths to search as an alternative to the positional <path>")707 .long_help(708 "Provide paths to search as an alternative to the positional <path> \704- argument. Changes the usage to `fd [FLAGS/OPTIONS] --search-path <path> \709+ argument. Changes the usage to `fd [OPTIONS] --search-path <path> \710 --search-path <path2> [<pattern>]`",711 ),712 )713 .arg(709- Arg::with_name("strip-cwd-prefix")714+ Arg::new("strip-cwd-prefix")715 .long("strip-cwd-prefix")716 .conflicts_with_all(&["path", "search-path"])712- .hidden_short_help(true)717+ .hide_short_help(true)718 .help("strip './' prefix from non-tty outputs")719 .long_help(720 "By default, relative paths are prefixed with './' when the output goes to a non \721 interactive terminal (TTY). Use this flag to disable this behaviour."1 unmodified line723 );724 725 if cfg!(unix) {726 app = app.arg(722- Arg::with_name("owner")727+ Arg::new("owner")728 .long("owner")724- .short("o")729+ .short('o')730 .takes_value(true)731 .value_name("user:group")732 .help("Filter by owning user and/or group")733 .long_help(12 unmodified lines746 // restrictions on the corresponding option in the `ignore` crate.747 // Provide aliases `mount` and `xdev` for people coming from `find`.748 if cfg!(any(unix, windows)) {749 app = app.arg(745- Arg::with_name("one-file-system")750+ Arg::new("one-file-system")751 .long("one-file-system")752 .aliases(&["mount", "xdev"])748- .hidden_short_help(true)753+ .hide_short_help(true)754 .help("Do not descend into a different file system")755 .long_help(756 "By default, fd will traverse the file system tree as far as other options \757 dictate. With this flag, fd ensures that it does not descend into a \4 unmodified lines762 }763 764 app765 }766+767+#[test]768+fn verify_app() {769+ build_app().debug_assert()770+}modified:tests/testenv/mod.rs+13 added-6 removed
128 unmodified lines129 lines.sort();130 lines.join("\n")131 }132 133+/// Trim whitespace from the beginning of each line.134+fn trim_lines(s: &str) -> String {135+ s.lines()136+ .map(|line| line.trim_start())137+ .fold(String::new(), |mut str, line| {138+ str.push_str(line);139+ str.push('\n');140+ str141+ })142+}143+144 impl TestEnv {145 pub fn new(directories: &[&'static str], files: &[&'static str]) -> TestEnv {146 let temp_dir = create_working_directory(directories, files).expect("working directory");147 let fd_exe = find_fd_exe();149 unmodified lines297 let output = cmd.output().expect("fd output");298 299 if let Some(expected) = expected {300 // Normalize both expected and actual output.290- let expected_error = normalize_output(expected, true, self.normalize_line);291- let actual_err = normalize_output(292- &String::from_utf8_lossy(&output.stderr),293- false,294- self.normalize_line,295- );301+ let expected_error = trim_lines(expected);302+ let actual_err = trim_lines(&String::from_utf8_lossy(&output.stderr));303 304 // Compare actual output to expected output.305 if !actual_err.trim_start().starts_with(&expected_error) {306 panic!(9 unmodified linesmodified:tests/tests.rs+2 added-2 removed
1418 unmodified lines1419 );1420 1421 te.assert_failure_with_error(1422 &["foo", "--exec-batch", "echo", "{/}", ";", "-x", "echo"],1423- "error: The argument '--exec <cmd>' cannot be used with '--exec-batch <cmd>'",1423+ "error: The argument '--exec-batch <cmd>...' cannot be used with '--exec <cmd>...'",1424 );1425 1426 te.assert_failure_with_error(1427 &["foo", "--exec-batch"],1428- "error: The argument '--exec-batch <cmd>' requires a value but none was supplied",1428+ "error: The argument '--exec-batch <cmd>...' requires a value but none was supplied",1429 );1430 1431 te.assert_failure_with_error(1432 &["foo", "--exec-batch", "echo {}"],586 unmodified linesmodified:build.rs+7 added-4 removed
1 use std::fs;2 3-use clap::Shell;3+use clap_complete::{generate_to, Shell};4+use Shell::*;5+//use clap_complete::shells::Shel{Bash, Fish, PowerShell, Elvish};6 7 include!("src/app.rs");8 9 fn main() {15 unmodified lines25 };26 fs::create_dir_all(&outdir).unwrap();27 28 let mut app = build_app();27- app.gen_completions("fd", Shell::Bash, &outdir);28- app.gen_completions("fd", Shell::Fish, &outdir);29- app.gen_completions("fd", Shell::PowerShell, &outdir);29+ // NOTE: zsh completions are hand written in contrib/completion/_fd30+ for shell in [Bash, PowerShell, Fish, Elvish] {31+ generate_to(shell, &mut app, "fd", &outdir).unwrap();32+ }33 }modified:Cargo.lock+67 added-35 removed
83 unmodified lines84 ]85 86 [[package]]87 name = "clap"88-version = "2.34.0"88+version = "3.0.5"89 source = "registry+https://github.com/rust-lang/crates.io-index"90-checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"90+checksum = "f6f34b09b9ee8c7c7b400fe2f8df39cafc9538b03d6ba7f4ae13e4cb90bfbb7d"91 dependencies = [92- "ansi_term",92 "atty",93 "bitflags",94+ "indexmap",95+ "lazy_static",96+ "os_str_bytes",97 "strsim",96- "term_size",98+ "termcolor",99+ "terminal_size",100 "textwrap",98- "unicode-width",99- "vec_map",101 ]102 103 [[package]]104+name = "clap_complete"105+version = "3.0.2"106+source = "registry+https://github.com/rust-lang/crates.io-index"107+checksum = "a394f7ec0715b42a4e52b294984c27c9a61f77c8d82f7774c5198350be143f19"108+dependencies = [109+ "clap",110+]111+112+[[package]]113 name = "crossbeam-utils"114 version = "0.8.5"115 source = "registry+https://github.com/rust-lang/crates.io-index"116 checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"47 unmodified lines164 "anyhow",165 "atty",166 "chrono",167 "clap",168+ "clap_complete",169 "ctrlc",170 "diff",171 "dirs-next",172 "filetime",69 unmodified lines242 "regex",243 ]244 245 [[package]]246+name = "hashbrown"247+version = "0.11.2"248+source = "registry+https://github.com/rust-lang/crates.io-index"249+checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"250+251+[[package]]252 name = "hermit-abi"253 version = "0.1.19"254 source = "registry+https://github.com/rust-lang/crates.io-index"255 checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"25 unmodified lines281 "winapi-util",282 ]283 284 [[package]]285+name = "indexmap"286+version = "1.8.0"287+source = "registry+https://github.com/rust-lang/crates.io-index"288+checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"289+dependencies = [290+ "autocfg",291+ "hashbrown",292+]293+294+[[package]]295 name = "jemalloc-sys"296 version = "0.3.2"297 source = "registry+https://github.com/rust-lang/crates.io-index"298 checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"50 unmodified lines349 checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"350 351 [[package]]352 name = "memoffset"326-version = "0.6.4"353+version = "0.6.5"354 source = "registry+https://github.com/rust-lang/crates.io-index"328-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"355+checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"356 dependencies = [357 "autocfg",358 ]359 54 unmodified lines414 source = "registry+https://github.com/rust-lang/crates.io-index"415 checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"416 417 [[package]]418+name = "os_str_bytes"419+version = "6.0.0"420+source = "registry+https://github.com/rust-lang/crates.io-index"421+checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"422+dependencies = [423+ "memchr",424+]425+426+[[package]]427 name = "proc-macro2"392-version = "1.0.32"428+version = "1.0.36"429 source = "registry+https://github.com/rust-lang/crates.io-index"394-checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"430+checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"431 dependencies = [432 "unicode-xid",433 ]434 435 [[package]]436 name = "quote"401-version = "1.0.10"437+version = "1.0.14"438 source = "registry+https://github.com/rust-lang/crates.io-index"403-checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"439+checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"440 dependencies = [441 "proc-macro2",442 ]443 89 unmodified lines533 ]534 535 [[package]]536 name = "strsim"501-version = "0.8.0"537+version = "0.10.0"538 source = "registry+https://github.com/rust-lang/crates.io-index"503-checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"539+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"540 541 [[package]]542 name = "syn"507-version = "1.0.82"543+version = "1.0.85"544 source = "registry+https://github.com/rust-lang/crates.io-index"509-checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"545+checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7"546 dependencies = [547 "proc-macro2",548 "quote",549 "unicode-xid",9 unmodified lines559 "remove_dir_all",560 ]561 562 [[package]]527-name = "term_size"528-version = "0.3.2"563+name = "termcolor"564+version = "1.1.2"565 source = "registry+https://github.com/rust-lang/crates.io-index"530-checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"566+checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"567 dependencies = [568+ "winapi-util",569+]570+571+[[package]]572+name = "terminal_size"573+version = "0.1.17"574+source = "registry+https://github.com/rust-lang/crates.io-index"575+checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"576+dependencies = [577 "libc",578 "winapi",579 ]580 11 unmodified lines592 ]593 594 [[package]]595 name = "textwrap"551-version = "0.11.0"596+version = "0.14.2"597 source = "registry+https://github.com/rust-lang/crates.io-index"553-checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"598+checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"599 dependencies = [555- "term_size",556- "unicode-width",600+ "terminal_size",601 ]602 603 [[package]]604 name = "thread_local"14 unmodified lines619 "winapi",620 ]621 622 [[package]]579-name = "unicode-width"580-version = "0.1.9"581-source = "registry+https://github.com/rust-lang/crates.io-index"582-checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"583-584-[[package]]623 name = "unicode-xid"624 version = "0.2.2"625 source = "registry+https://github.com/rust-lang/crates.io-index"626 checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"8 unmodified lines635 "log",636 ]637 638 [[package]]601-name = "vec_map"602-version = "0.8.2"603-source = "registry+https://github.com/rust-lang/crates.io-index"604-checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"605-606-[[package]]639 name = "version_check"640 version = "0.9.4"641 source = "registry+https://github.com/rust-lang/crates.io-index"642 checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"48 unmodified linesmodified:Cargo.toml+4 added-3 removed
28 unmodified lines293031323333343536373812 unmodified lines51525354545555565758596023 unmodified lines28 unmodified linesname = "fd"path = "src/main.rs"
[build-dependencies]clap = "2.34.0"clap = "3.0"clap_complete = "3.0"version_check = "0.9"
[dependencies]ansi_term = "0.12"12 unmodified lineschrono = "0.4"once_cell = "1.9.0"
[dependencies.clap]version = "2.34.0"features = ["suggestions", "color", "wrap_help"]version = "3.0"features = ["suggestions", "color", "wrap_help", "cargo"]
[target.'cfg(unix)'.dependencies]users = "0.11.0"nix = "0.23.1"23 unmodified lines