1
0
mirror of https://github.com/jht5945/finding.git synced 2026-01-12 12:00:03 +08:00

Compare commits

..

36 Commits

Author SHA1 Message Date
20ba3259d2 feat: update cname 2025-07-26 10:44:10 +08:00
5d2ec01348 feat: v0.2.1 2025-03-22 23:27:14 +08:00
d789934de1 Update CNAME 2023-04-16 08:37:53 +08:00
17a02c34b9 Create CNAME 2021-07-04 07:54:39 +08:00
13a718487b Set theme jekyll-theme-cayman 2021-07-04 07:54:24 +08:00
bb8103dac9 style: code style 2020-08-02 22:30:48 +08:00
6f274d9a46 is_skip_link_and_is_link 2020-05-02 00:34:54 +08:00
b42086b865 j -> i 2020-05-02 00:32:26 +08:00
1cd44f5cbb use is_skip_link 2020-05-02 00:31:03 +08:00
0fda440d02 ref parts 2020-05-02 00:24:18 +08:00
1cbeccfd9a ref for 2020-05-02 00:23:17 +08:00
e430e037bc ref print 2020-05-02 00:21:49 +08:00
5b78fa85bc use chars 2020-05-02 00:18:56 +08:00
e0a85b1368 use (line_no, ln) in lines.enumerate() 2020-05-02 00:16:39 +08:00
ca8a3fb848 move to local_util 2020-05-01 22:16:52 +08:00
204e82635a version verbose 2020-05-01 22:10:07 +08:00
713cbdc67f fix size 2020-05-01 22:04:18 +08:00
9818c25f15 use CountCell 2020-05-01 21:38:47 +08:00
68d51461bd len_of_large_file 2020-04-30 01:11:09 +08:00
cb6f3cd4bd len_of_large_file 2020-04-30 01:10:47 +08:00
b2dc1d868c &Path -> AsRef<Path> 2020-04-30 01:09:28 +08:00
29fea6ac49 re format 2020-04-30 01:05:41 +08:00
63afb268ef add a 2020-04-30 01:01:17 +08:00
eefbb3d49e reformat 2020-04-30 00:53:41 +08:00
84a0c444a0 RefCell -> Cell 2020-04-30 00:51:37 +08:00
f9d873659e opt to_str 2020-04-29 08:17:50 +08:00
0e4024337f unwrap_or -> ok 2020-04-28 00:42:17 +08:00
03bbba3193 l_no -> line_no 2020-04-28 00:40:43 +08:00
39b6cbde6a fix clippy 2020-04-28 00:39:17 +08:00
93d39ecd50 use iter any 2020-04-28 00:38:05 +08:00
6b7c2b3759 ref c 2020-04-28 00:25:25 +08:00
640293989c ref verbose 2020-04-28 00:17:29 +08:00
efa006f745 add --skip-target-dir 2020-04-28 00:11:34 +08:00
2ce9540577 use clear_n_print_message 2020-04-28 00:04:10 +08:00
8008f27518 fix clippy 2020-04-28 00:03:40 +08:00
be4a25f0c7 update 2020-04-27 23:33:21 +08:00
8 changed files with 360 additions and 425 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.idea/
# Generated by Cargo
# will have compiled files and executables
/target/

1
CNAME Normal file
View File

@@ -0,0 +1 @@
finding.ruststack.org

392
Cargo.lock generated
View File

@@ -1,371 +1,333 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "argparse"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47"
[[package]]
name = "arrayref"
version = "0.3.5"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
[[package]]
name = "arrayvec"
version = "0.5.1"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "backtrace"
version = "0.3.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace-sys"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
]
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "base64"
version = "0.10.1"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"
[[package]]
name = "bitflags"
version = "1.2.1"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
[[package]]
name = "blake2b_simd"
version = "0.5.9"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
dependencies = [
"arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"arrayref",
"arrayvec",
"constant_time_eq",
]
[[package]]
name = "byteorder"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cc"
version = "1.0.48"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cfg-if"
version = "0.1.10"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cloudabi"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "constant_time_eq"
version = "0.1.4"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "crossbeam-utils"
version = "0.6.6"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "dirs"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
dependencies = [
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc",
"redox_users 0.3.5",
"winapi",
]
[[package]]
name = "failure"
version = "0.1.6"
name = "dirs-next"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
dependencies = [
"backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)",
"failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if",
"dirs-sys-next",
]
[[package]]
name = "failure_derive"
version = "0.1.6"
name = "dirs-sys-next"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc",
"redox_users 0.4.6",
"winapi",
]
[[package]]
name = "finding"
version = "0.1.3"
version = "0.2.1"
dependencies = [
"argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rust_util 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"argparse",
"rust_util",
"term 0.5.2",
"term_size",
]
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
name = "getrandom"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
name = "getrandom"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if",
"libc",
"wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.66"
version = "0.2.171"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
[[package]]
name = "libredox"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags",
"libc",
]
[[package]]
name = "proc-macro2"
version = "1.0.6"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
dependencies = [
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.2"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand_os"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2",
]
[[package]]
name = "redox_syscall"
version = "0.1.56"
version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "redox_users"
version = "0.3.1"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d"
dependencies = [
"failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)",
"rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"getrandom 0.1.16",
"redox_syscall",
"rust-argon2",
]
[[package]]
name = "redox_users"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [
"getrandom 0.2.15",
"libredox",
"thiserror",
]
[[package]]
name = "rust-argon2"
version = "0.5.1"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"base64",
"blake2b_simd",
"constant_time_eq",
"crossbeam-utils",
]
[[package]]
name = "rust_util"
version = "0.1.0"
version = "0.6.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bca5d3493eb29d08dc76ee784a78723fe366fec5dfe67ab37da9d50fb868f7c"
dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static",
"libc",
"term 0.7.0",
"term_size",
]
[[package]]
name = "rustc-demangle"
version = "0.1.16"
name = "rustversion"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
[[package]]
name = "syn"
version = "1.0.11"
version = "2.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "synstructure"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "term"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42"
dependencies = [
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder",
"dirs",
"winapi",
]
[[package]]
name = "term"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
dependencies = [
"dirs-next",
"rustversion",
"winapi",
]
[[package]]
name = "term_size"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
dependencies = [
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc",
"winapi",
]
[[package]]
name = "unicode-xid"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.3.8"
name = "thiserror"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"thiserror-impl",
]
[[package]]
name = "winapi-build"
version = "0.1.1"
name = "thiserror-impl"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum argparse 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3f8ebf5827e4ac4fd5946560e6a99776ea73b596d80898f357007317a7141e47"
"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee"
"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea"
"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491"
"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0"
"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
"checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76"
"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120"
"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
"checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901"
"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9"
"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08"
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27"
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d"
"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf"
"checksum rust_util 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5dc9b9d45cf4e9a8a28c1c622f0a2bba9af88b85ec04c494d80605a717c1c022"
"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238"
"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545"
"checksum term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "edd106a334b7657c10b7c540a0106114feadeb4dc314513e97df481d5d966f42"
"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"
"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

View File

@@ -1,6 +1,6 @@
[package]
name = "finding"
version = "0.1.3"
version = "0.2.1"
authors = ["Hatter Jiang <jht5945@gmail.com>"]
edition = "2018"
description = "command line finding tool"
@@ -12,4 +12,4 @@ license = "MIT"
argparse = "0.2.2"
term = "0.5.2"
term_size = "0.3.1"
rust_util = "0.1.0"
rust_util = "0.6.3"

1
_config.yml Normal file
View File

@@ -0,0 +1 @@
theme: jekyll-theme-cayman

View File

@@ -1,28 +1,60 @@
use std:: {
use std::{
cell::Cell,
fs::File,
path::Path,
io::prelude::*,
};
use rust_util::{ XResult, new_box_error, };
use rust_util::{
XResult,
new_box_error,
};
#[derive(Debug)]
pub struct MatchLine {
pub line_number: usize,
pub line_string: String,
}
pub fn read_file_content(file: &Path, large_file_len: u64) -> XResult<String> {
if ! file.exists() {
impl MatchLine {
pub fn new(line_number: usize, line_string: String) -> MatchLine {
MatchLine { line_number, line_string, }
}
}
pub struct CountCell( Cell<u64> );
impl CountCell {
pub fn new() -> CountCell {
CountCell( Cell::new(0_u64) )
}
#[inline]
pub fn get(&self) -> u64 {
self.0.get()
}
#[inline]
pub fn add(&self, i: u64) {
self.0.set(self.0.get() + i);
}
#[inline]
pub fn add_one(&self) {
self.add(1);
}
}
pub fn read_file_content<P: AsRef<Path>>(p: P, len_of_large_file: u64) -> XResult<String> {
let file = p.as_ref();
if !file.exists() {
return Err(new_box_error(&format!("File not exists: {:?}", file)));
}
if ! file.is_file() {
return Err(new_box_error(&format!("File is not file: {:?}", file)));
if !file.is_file() {
return Err(new_box_error(&format!("File is not a file: {:?}", file)));
}
let file_len = file.metadata()?.len();
if file_len > large_file_len {
if file_len >= len_of_large_file {
return Err(new_box_error(&format!("File too large: {:?}, len: {}", file, file_len)));
}
let mut f = File::open(file)?;
let mut content = String::new();
let mut content = String::with_capacity(file_len as usize);
f.read_to_string(&mut content)?;
Ok(content)

View File

@@ -1,284 +1,224 @@
extern crate argparse;
extern crate term;
extern crate term_size;
#[macro_use]
extern crate rust_util;
mod opt;
mod local_util;
use std::{
cell::RefCell,
path::Path,
time::SystemTime,
time::{ Duration, SystemTime },
};
use opt::*;
use rust_util::{
XResult,
new_box_error,
util_file::*,
util_size::*,
util_msg::*,
};
use local_util::*;
use rust_util::util_msg::{MessageType, print_lastline, print_message, get_term_width_message, print_color_and_flush};
use local_util::{ CountCell, MatchLine, read_file_content };
const EMPTY: &str = "";
const VERSION: &str = env!("CARGO_PKG_VERSION");
const GIT_HASH: &str = env!("GIT_HASH");
fn print_version() {
fn print_version(options: &Options) {
println!(r#"finding {} - {}
Copyright (C) 2019 Hatter Jiang.
Copyright (C) 2019-2020 Hatter Jiang.
License MIT <https://opensource.org/licenses/MIT>
Written by Hatter Jiang"#, VERSION, &GIT_HASH[0..7]);
if options.verbose {
debugging!("Version: {}", VERSION);
debugging!("Git hash: {}", GIT_HASH);
}
}
fn clear_n_print_message(mt: MessageType, message: &str) {
print_lastline(EMPTY);
print_message(mt, message);
}
fn find_huge_files(options: &Options, dir_path: &Path) {
let total_file_count_cell = RefCell::new(0u64);
let huge_file_count_cell = RefCell::new(0u64);
let huge_file_size_cell = RefCell::new(0u64);
walk_dir(&dir_path, &|_, _| (/* do not process error */), &|p| {
total_file_count_cell.replace_with(|&mut c| c + 1);
let total_file_count = CountCell::new();
let huge_file_count = CountCell::new();
let huge_file_size = CountCell::new();
walk_dir(&dir_path, &|_, _| (/* do not process error */), &|p| { // process file
total_file_count.add_one();
let p_str = match p.to_str() {
Some(s) => s, None => return,
};
match p.metadata() {
Err(err) => {
if options.verbose {
if let Some(p_str) = p.to_str() {
print_lastline("");
print_message(MessageType::WARN, &format!("Read file {} meta failed: {}", p_str, err));
}
}
return;
Err(err) => if options.verbose {
clear_n_print_message(MessageType::WARN, &format!("Read file {} meta failed: {}", p_str, err));
},
Ok(metadata) => {
let len = metadata.len();
if len >= options.parsed_huge_file_size {
huge_file_count_cell.replace_with(|&mut c| c + 1);
huge_file_size_cell.replace_with(|&mut c| c + len);
match p.to_str() {
None => (),
Some(p_str) => {
print_lastline("");
print_message(MessageType::OK, &format!("{} [{}]", p_str, get_display_size(len as i64)));
},
}
huge_file_count.add_one();
huge_file_size.add(len);
clear_n_print_message(MessageType::OK, &format!("{} [{}]", p_str, get_display_size(len as i64)));
}
},
}
}, &|p| {
match p.to_str() {
None => (),
Some(p_str) => {
if options.skip_link_dir && is_symlink(p) {
if options.verbose {
print_lastline("");
print_message(MessageType::INFO, &format!("Skip link dir: {}", p_str));
}
return false;
}
print_lastline(&get_term_width_message(&format!("Scanning: {}", p_str), 10))
},
}, &|p| { // process path
let p_str = match p.to_str() {
Some(s) => s, None => return false,
};
let is_skip_link_and_is_link = options.skip_link_dir && is_symlink(p);
if is_skip_link_and_is_link {
if options.verbose {
clear_n_print_message(MessageType::DEBUG, &format!("Skip link dir: {}", p_str));
}
} else {
print_lastline(&get_term_width_message(&format!("Scanning: {}", p_str), 10));
}
true
}).unwrap_or(());
print_lastline("");
print_message(MessageType::OK, &format!("Total file count: {}, huge file count: {}, total huge file size: {}",
total_file_count_cell.into_inner(),
huge_file_count_cell.into_inner(),
get_display_size(huge_file_size_cell.into_inner() as i64)));
}
#[derive(Debug)]
struct MatchLine {
line_number: usize,
line_string: String,
}
impl MatchLine {
fn new(l_no: usize, l_str: String) -> MatchLine {
MatchLine {
line_number: l_no,
line_string: l_str,
}
}
!is_skip_link_and_is_link
}).ok();
clear_n_print_message(MessageType::OK, &format!("Total file count: {}, huge file count: {}, total huge file size: {}",
total_file_count.get(),
huge_file_count.get(),
get_display_size(huge_file_size.get() as i64)));
}
fn match_lines(tag: &str, content: &str, options: &Options) -> bool {
let search_text = &options.search_text;
let lines = content.lines();
let mut match_lines_vec = vec![];
let mut l_no = 0usize;
let the_search_text = &match options.ignore_case {
true => search_text.to_lowercase(),
false => search_text.to_string(),
};
for ln in lines {
let the_search_text = &iff!(options.ignore_case, search_text.to_lowercase(), search_text.to_string());
for (line_no, ln) in lines.enumerate() {
if options.filter_large_line && ln.len() as u64 >= options.parsed_large_line_size {
if options.verbose {
print_lastline("");
print_message(MessageType::INFO, &format!("Skip large line: {} bytes", ln.len()));
clear_n_print_message(MessageType::DEBUG, &format!("Skip large line: {} chars", ln.len()));
}
continue;
}
let matches = match options.ignore_case {
true => ln.to_lowercase().contains(the_search_text),
false => ln.contains(the_search_text),
let matches = iff!(options.ignore_case, ln.to_lowercase().contains(the_search_text), ln.contains(the_search_text));
let matches_line_content = match &options.filter_line_content {
c if c.is_empty() => true,
c => ln.contains(c),
};
let mut matches_line_content = true;
if !options.filter_line_content.is_empty(){
if ! ln.contains(options.filter_line_content.as_str()) {
matches_line_content = false;
}
}
if matches && matches_line_content {
match_lines_vec.push(MatchLine::new(l_no, ln.to_string()));
match_lines_vec.push(MatchLine::new(line_no, ln.to_string()));
}
l_no += 1;
}
let mut matches_any = false;
if !match_lines_vec.is_empty() {
print_lastline("");
print_message(MessageType::OK, &format!("Find in {}:", tag));
for i in 0..match_lines_vec.len() {
print!("{}: ", match_lines_vec[i].line_number + 1);
match options.ignore_case {
true => println!("{}", match_lines_vec[i].line_string),
false => {
let ss: Vec<&str> = match_lines_vec[i].line_string.split(search_text).collect();
for j in 0..ss.len() {
print!("{}", ss[j]);
if j < ss.len() -1 {
print_color(Some(term::color::RED), true, search_text);
}
clear_n_print_message(MessageType::OK, &format!("Find in {}:", tag));
for match_line in &match_lines_vec {
print!("{}: ", match_line.line_number + 1);
if options.ignore_case {
println!("{}", match_line.line_string);
} else {
let parts = match_line.line_string.split(search_text).collect::<Vec<_>>();
for (i, part) in parts.iter().enumerate() {
if i != 0 {
print_color_and_flush( Some(term::color::RED), true, search_text);
}
println!();
},
print!("{}", part);
}
println!();
}
}
matches_any = true;
}
matches_any
!match_lines_vec.is_empty()
}
fn find_text_files(options: &Options, dir_path: &Path) {
if options.search_text.is_empty() {
print_message(MessageType::ERROR, "Param search_text cannot be empty.");
failure!("Param search_text cannot be empty.");
return;
}
if options.ignore_case {
print_message(MessageType::WARN, "Using ignore case mode, highlight print is disabled.");
warning!("Using ignore case mode, highlight print is disabled.");
}
let file_exts = match options.file_ext.as_str() {
"" => vec![],
ext => {
ext.split(',').map(|s| s.trim()).filter(|s| !s.is_empty()).map(|s| String::from(".") + s).collect()
},
let file_exts = match &options.file_ext {
ext if ext.is_empty() => vec![],
ext => ext.split(',').map(|s| s.trim()).filter(|s| !s.is_empty()).map(|s| ".".to_owned() + s).collect(),
};
let total_file_count_cell = RefCell::new(0u64);
let scaned_file_count_cell = RefCell::new(0u64);
let matched_file_count_cell = RefCell::new(0u64);
let total_dir_count_cell = RefCell::new(0u64);
let scaned_dir_count_cell = RefCell::new(0u64);
walk_dir(&dir_path, &|_, _| (/* do not process error */), &|p| {
total_file_count_cell.replace_with(|&mut c| c + 1);
let total_file_count = CountCell::new();
let scaned_file_count = CountCell::new();
let matched_file_count = CountCell::new();
let total_dir_count = CountCell::new();
let scaned_dir_count = CountCell::new();
walk_dir(&dir_path, &|_, _| (/* do not process error */), &|p| { // process file
total_file_count.add_one();
let p_str = match p.to_str() {
None => return,
Some(s) => s,
Some(s) => s, None => return,
};
if !file_exts.is_empty() {
let mut file_ext_matches = false;
for file_ext in &file_exts {
if p_str.to_lowercase().ends_with(file_ext) {
file_ext_matches = true;
break;
}
}
if ! file_ext_matches {
return;
}
if !file_exts.is_empty() && !file_exts.iter().any(|file_ext| p_str.to_lowercase().ends_with(file_ext)) {
return;
}
if !options.filter_file_name.is_empty() {
if ! p_str.contains(options.filter_file_name.as_str()) {
return;
}
if !options.filter_file_name.is_empty() && !p_str.contains(options.filter_file_name.as_str()) {
return;
}
let file_content = match read_file_content(p, options.parsed_large_text_file_size) {
Err(err) => {
if options.verbose {
print_lastline("");
print_message(MessageType::WARN, &format!("Read file {} failed: {}", p_str, err));
}
Ok(c) => c, Err(err) => {
if options.verbose { clear_n_print_message(MessageType::WARN, &format!("Read file {} failed: {}", p_str, err)); }
return;
},
Ok(c) => c,
};
scaned_file_count_cell.replace_with(|&mut c| c + 1);
scaned_file_count.add_one();
if match_lines(p_str, &file_content, &options) {
matched_file_count_cell.replace_with(|&mut c| c + 1);
matched_file_count.add_one();
}
}, &|p| {
total_dir_count_cell.replace_with(|&mut c| c + 1);
match p.to_str() {
None => (),
Some(p_str) => {
if (! options.scan_dot_git) && p_str.ends_with("/.git") {
if options.verbose {
print_lastline("");
print_message(MessageType::INFO, &format!("Skip .git dir: {}", p_str));
}
return false;
}
if options.skip_dot_dir && p_str.contains("/.") {
return false;
}
if options.skip_link_dir && is_symlink(p) {
if options.verbose {
print_lastline("");
print_message(MessageType::INFO, &format!("Skip link dir: {}", p_str));
}
return false;
}
scaned_dir_count_cell.replace_with(|&mut c| c + 1);
print_lastline(&get_term_width_message(&format!("Scanning: {}", p_str), 10))
},
}, &|p| { // process path
total_dir_count.add_one();
let p_str = match p.to_str() {
Some(s) => s, None => return false,
};
if (!options.scan_dot_git_dir) && p_str.ends_with("/.git") {
if options.verbose { clear_n_print_message(MessageType::DEBUG, &format!("Skip .git dir: {}", p_str)); }
return false;
}
if options.skip_target_dir && p_str.ends_with("/target") {
if options.verbose { clear_n_print_message(MessageType::DEBUG, &format!("Skip target dir: {}", p_str)); }
return false;
}
if options.skip_dot_dir && p_str.contains("/.") {
if options.verbose { clear_n_print_message(MessageType::DEBUG, &format!("Skip dot(.) dir: {}", p_str)); }
return false;
}
if options.skip_link_dir && is_symlink(p) {
if options.verbose { clear_n_print_message(MessageType::DEBUG, &format!("Skip link dir: {}", p_str)); }
return false;
}
scaned_dir_count.add_one();
print_lastline(&get_term_width_message(&format!("Scanning: {}", p_str), 10));
true
}).unwrap_or(());
print_lastline("");
print_message(MessageType::OK, &format!("Total dir count: {}, scaned dir count: {}",
total_dir_count_cell.into_inner(),
scaned_dir_count_cell.into_inner()));
print_message(MessageType::OK, &format!("Total file count: {}, scaned file count: {}, matched file count: {}",
total_file_count_cell.into_inner(),
scaned_file_count_cell.into_inner(),
matched_file_count_cell.into_inner()));
}).ok();
print_lastline(EMPTY);
success!("Total dir count: {}, scaned dir count: {}",
total_dir_count.get(),
scaned_dir_count.get());
success!("Total file count: {}, scaned file count: {}, matched file count: {}",
total_file_count.get(),
scaned_file_count.get(),
matched_file_count.get());
}
fn main() -> XResult<()> {
let options = Options::new_and_parse_args()?;
if options.version {
print_version();
print_version(&options);
return Ok(());
}
let dir_path = match get_absolute_path(&options.dir) {
None => {
return Err(new_box_error(&format!("Cannot find dir: {}", options.dir)));
},
Some(path) => path,
None => return Err(new_box_error(&format!("Cannot find dir: {}", options.dir))),
};
let start = SystemTime::now();
match options.target.as_str() {
"huge" | "hugefile" => find_huge_files(&options, &dir_path),
"text" => find_text_files(&options, &dir_path),
unknown => {
return Err(new_box_error(&format!("Unknown command: {}", unknown)));
},
others => return Err(new_box_error(&format!("Unknown command: {}", others))),
}
let cost_millis = SystemTime::now().duration_since(start.clone()).unwrap().as_millis();
print_message(MessageType::OK, &format!("Finding finished, cost {} ms", cost_millis));
let cost_millis = SystemTime::now().duration_since(start).unwrap_or_else(|_| Duration::from_millis(0)).as_millis();
success!("Finding finished, cost {} ms", cost_millis);
Ok(())
}

View File

@@ -1,10 +1,5 @@
use argparse::{ArgumentParser, StoreTrue, Store};
use rust_util::{
XResult,
util_size::*,
};
use argparse::{ ArgumentParser, StoreTrue, Store, };
use rust_util::{ XResult, util_size::*, };
pub struct Options {
pub version: bool,
@@ -19,9 +14,10 @@ pub struct Options {
pub filter_large_line: bool,
pub large_line_size: String,
pub parsed_large_line_size: u64,
pub scan_dot_git: bool,
pub scan_dot_git_dir: bool,
pub skip_dot_dir: bool,
pub skip_link_dir: bool,
pub skip_target_dir: bool,
pub filter_file_name: String,
pub filter_line_content: String,
pub verbose: bool,
@@ -43,9 +39,10 @@ impl Options {
filter_large_line: false,
large_line_size: String::from("10KB"),
parsed_large_line_size: 0u64,
scan_dot_git: false,
scan_dot_git_dir: false,
skip_dot_dir: false,
skip_link_dir: false,
skip_target_dir: false,
filter_file_name: String::new(),
filter_line_content: String::new(),
verbose: false,
@@ -65,9 +62,10 @@ impl Options {
ap.refer(&mut self.ignore_case).add_option(&["-i", "--ignore-case"], StoreTrue, "Ignore case, default false");
ap.refer(&mut self.filter_large_line).add_option(&["--filter-large-line"], StoreTrue, "Filter large line");
ap.refer(&mut self.large_line_size).add_option(&["--large-line-size"], Store, "Large line, default 10KB");
ap.refer(&mut self.scan_dot_git).add_option(&["--scan-dot-git"], StoreTrue, "Scan dot git");
ap.refer(&mut self.scan_dot_git_dir).add_option(&["--scan-dot-git"], StoreTrue, "Scan dot git");
ap.refer(&mut self.skip_dot_dir).add_option(&["--skip-dot-dir"], StoreTrue, "Skipt dot dir [Text Mode]");
ap.refer(&mut self.skip_link_dir).add_option(&["--skip-link-dir"], StoreTrue, "Skip link dir");
ap.refer(&mut self.skip_target_dir).add_option(&["--skip-target-dir"], StoreTrue, "Skip target dir");
ap.refer(&mut self.filter_file_name).add_option(&["--filter-file-name"], Store, "Filter file name [Text Mode]");
ap.refer(&mut self.filter_line_content).add_option(&["--filter-line-content"], Store, "Filter line content [Text Mode]");
ap.refer(&mut self.version).add_option(&["-v", "--version"], StoreTrue, "Print version");