Compare commits
1 Commits
main
...
d38a086be6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d38a086be6 |
21
CHANGELOG.md
21
CHANGELOG.md
@@ -6,31 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.1.2] - 2025-08-08
|
## [0.0.6] - 2025-07-26
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- default to current dir if no file could be found
|
|
||||||
|
|
||||||
### Other
|
|
||||||
- should be space instead
|
|
||||||
|
|
||||||
## [0.1.1] - 2025-08-04
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- if path is empty default to `.`
|
|
||||||
|
|
||||||
## [0.1.0] - 2025-08-03
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- add open command
|
|
||||||
- noil now handles open, and open in non-terminals via. /dev/tty
|
|
||||||
- add file opener with chooser
|
|
||||||
- update demo
|
- update demo
|
||||||
- add help text for preview
|
- add help text for preview
|
||||||
|
|
||||||
### Other
|
|
||||||
- remove cockroach
|
|
||||||
|
|
||||||
## [0.0.5] - 2025-07-26
|
## [0.0.5] - 2025-07-26
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
350
Cargo.lock
generated
350
Cargo.lock
generated
@@ -2,6 +2,21 @@
|
|||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 4
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "addr2line"
|
||||||
|
version = "0.24.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
|
||||||
|
dependencies = [
|
||||||
|
"gimli",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "adler2"
|
||||||
|
version = "2.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
@@ -72,9 +87,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.100"
|
version = "1.0.98"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayref"
|
name = "arrayref"
|
||||||
@@ -94,6 +109,21 @@ version = "1.5.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "backtrace"
|
||||||
|
version = "0.3.75"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
|
||||||
|
dependencies = [
|
||||||
|
"addr2line",
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
"miniz_oxide",
|
||||||
|
"object",
|
||||||
|
"rustc-demangle",
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.9.1"
|
version = "2.9.1"
|
||||||
@@ -146,9 +176,9 @@ checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.53"
|
version = "4.5.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8"
|
checksum = "be92d32e80243a54711e5d7ce823c35c41c9d929dc4ab58e1276f625841aadf9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@@ -156,9 +186,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.53"
|
version = "4.5.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00"
|
checksum = "707eab41e9622f9139419d573eca0900137718000c517d47da73045f54331c3d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -168,9 +198,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "4.5.49"
|
version = "4.5.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671"
|
checksum = "ef4f52386a59ca4c860f7393bcf8abd8dfd91ecccc0f774635ff68e92eeef491"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -227,44 +257,12 @@ version = "0.1.13"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dirs"
|
|
||||||
version = "6.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
|
|
||||||
dependencies = [
|
|
||||||
"dirs-sys",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dirs-sys"
|
|
||||||
version = "0.5.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"option-ext",
|
|
||||||
"redox_users",
|
|
||||||
"windows-sys 0.59.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dotenvy"
|
name = "dotenvy"
|
||||||
version = "0.15.7"
|
version = "0.15.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "getrandom"
|
|
||||||
version = "0.2.16"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
|
|
||||||
dependencies = [
|
|
||||||
"cfg-if",
|
|
||||||
"libc",
|
|
||||||
"wasi 0.11.1+wasi-snapshot-preview1",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.3.3"
|
version = "0.3.3"
|
||||||
@@ -278,10 +276,16 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "globset"
|
name = "gimli"
|
||||||
version = "0.4.18"
|
version = "0.31.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3"
|
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "globset"
|
||||||
|
version = "0.4.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"bstr",
|
"bstr",
|
||||||
@@ -298,9 +302,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ignore"
|
name = "ignore"
|
||||||
version = "0.4.25"
|
version = "0.4.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a"
|
checksum = "6d89fd380afde86567dfba715db065673989d6253f42b88179abd3eae47bda4b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam-deque",
|
"crossbeam-deque",
|
||||||
"globset",
|
"globset",
|
||||||
@@ -312,6 +316,17 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "io-uring"
|
||||||
|
version = "0.7.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
"cfg-if",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is_terminal_polyfill"
|
name = "is_terminal_polyfill"
|
||||||
version = "1.70.1"
|
version = "1.70.1"
|
||||||
@@ -330,16 +345,6 @@ version = "0.2.174"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "libredox"
|
|
||||||
version = "0.1.9"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "391290121bad3d37fbddad76d8f5d1c1c314cfc646d143d7e07a3086ddff0ce3"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags",
|
|
||||||
"libc",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lock_api"
|
name = "lock_api"
|
||||||
version = "0.4.13"
|
version = "0.4.13"
|
||||||
@@ -362,6 +367,15 @@ version = "2.7.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "miniz_oxide"
|
||||||
|
version = "0.8.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
|
||||||
|
dependencies = [
|
||||||
|
"adler2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mio"
|
name = "mio"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
@@ -375,7 +389,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "noil"
|
name = "noil"
|
||||||
version = "0.1.2"
|
version = "0.0.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -385,7 +399,6 @@ dependencies = [
|
|||||||
"ignore",
|
"ignore",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"rand",
|
"rand",
|
||||||
"shellexpand",
|
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
@@ -394,11 +407,21 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-ansi-term"
|
name = "nu-ansi-term"
|
||||||
version = "0.50.3"
|
version = "0.46.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.59.0",
|
"overload",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "object"
|
||||||
|
version = "0.36.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -414,10 +437,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
|
checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "option-ext"
|
name = "overload"
|
||||||
version = "0.2.0"
|
version = "0.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
|
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parking_lot"
|
name = "parking_lot"
|
||||||
@@ -439,7 +462,7 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows-targets 0.52.6",
|
"windows-targets",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -517,7 +540,7 @@ version = "0.9.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
|
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"getrandom 0.3.3",
|
"getrandom",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -529,17 +552,6 @@ dependencies = [
|
|||||||
"bitflags",
|
"bitflags",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "redox_users"
|
|
||||||
version = "0.5.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a4e608c6638b9c18977b00b475ac1f28d14e84b27d8d42f70e0bf1e3dec127ac"
|
|
||||||
dependencies = [
|
|
||||||
"getrandom 0.2.16",
|
|
||||||
"libredox",
|
|
||||||
"thiserror",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-automata"
|
name = "regex-automata"
|
||||||
version = "0.4.9"
|
version = "0.4.9"
|
||||||
@@ -557,6 +569,12 @@ version = "0.8.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc-demangle"
|
||||||
|
version = "0.1.25"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@@ -601,15 +619,6 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "shellexpand"
|
|
||||||
version = "3.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8b1fdf65dd6331831494dd616b30351c38e96e45921a27745cf98490458b90bb"
|
|
||||||
dependencies = [
|
|
||||||
"dirs",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shlex"
|
name = "shlex"
|
||||||
version = "1.3.0"
|
version = "1.3.0"
|
||||||
@@ -625,6 +634,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "slab"
|
||||||
|
version = "0.4.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
version = "1.15.1"
|
version = "1.15.1"
|
||||||
@@ -633,12 +648,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "socket2"
|
name = "socket2"
|
||||||
version = "0.6.1"
|
version = "0.5.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
|
checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.60.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -658,26 +673,6 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror"
|
|
||||||
version = "2.0.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
|
|
||||||
dependencies = [
|
|
||||||
"thiserror-impl",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "thiserror-impl"
|
|
||||||
version = "2.0.12"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thread_local"
|
name = "thread_local"
|
||||||
version = "1.1.9"
|
version = "1.1.9"
|
||||||
@@ -689,26 +684,29 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.48.0"
|
version = "1.46.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408"
|
checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
"io-uring",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
|
"slab",
|
||||||
"socket2",
|
"socket2",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-macros"
|
name = "tokio-macros"
|
||||||
version = "2.6.0"
|
version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
|
checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -717,9 +715,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing"
|
name = "tracing"
|
||||||
version = "0.1.43"
|
version = "0.1.41"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2d15d90a0b5c19378952d479dc858407149d7bb45a14de0142f6c534b16fc647"
|
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
@@ -729,9 +727,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-attributes"
|
name = "tracing-attributes"
|
||||||
version = "0.1.31"
|
version = "0.1.30"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
|
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -740,9 +738,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-core"
|
name = "tracing-core"
|
||||||
version = "0.1.35"
|
version = "0.1.34"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a04e24fab5c89c6a36eb8558c9656f30d81de51dfa4d3b45f26b21d61fa0a6c"
|
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"valuable",
|
"valuable",
|
||||||
@@ -761,9 +759,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tracing-subscriber"
|
name = "tracing-subscriber"
|
||||||
version = "0.3.22"
|
version = "0.3.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e"
|
checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
"sharded-slab",
|
"sharded-slab",
|
||||||
@@ -848,10 +846,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-link"
|
name = "windows-sys"
|
||||||
version = "0.2.1"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
@@ -859,25 +860,7 @@ version = "0.59.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.52.6",
|
"windows-targets",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-sys"
|
|
||||||
version = "0.60.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
|
||||||
dependencies = [
|
|
||||||
"windows-targets 0.53.5",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-sys"
|
|
||||||
version = "0.61.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
|
||||||
dependencies = [
|
|
||||||
"windows-link",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -886,31 +869,14 @@ version = "0.52.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_gnullvm 0.52.6",
|
"windows_aarch64_gnullvm",
|
||||||
"windows_aarch64_msvc 0.52.6",
|
"windows_aarch64_msvc",
|
||||||
"windows_i686_gnu 0.52.6",
|
"windows_i686_gnu",
|
||||||
"windows_i686_gnullvm 0.52.6",
|
"windows_i686_gnullvm",
|
||||||
"windows_i686_msvc 0.52.6",
|
"windows_i686_msvc",
|
||||||
"windows_x86_64_gnu 0.52.6",
|
"windows_x86_64_gnu",
|
||||||
"windows_x86_64_gnullvm 0.52.6",
|
"windows_x86_64_gnullvm",
|
||||||
"windows_x86_64_msvc 0.52.6",
|
"windows_x86_64_msvc",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-targets"
|
|
||||||
version = "0.53.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
|
|
||||||
dependencies = [
|
|
||||||
"windows-link",
|
|
||||||
"windows_aarch64_gnullvm 0.53.1",
|
|
||||||
"windows_aarch64_msvc 0.53.1",
|
|
||||||
"windows_i686_gnu 0.53.1",
|
|
||||||
"windows_i686_gnullvm 0.53.1",
|
|
||||||
"windows_i686_msvc 0.53.1",
|
|
||||||
"windows_x86_64_gnu 0.53.1",
|
|
||||||
"windows_x86_64_gnullvm 0.53.1",
|
|
||||||
"windows_x86_64_msvc 0.53.1",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -919,96 +885,48 @@ version = "0.52.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_gnullvm"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_msvc"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnu"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnullvm"
|
name = "windows_i686_gnullvm"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnullvm"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_msvc"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnu"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnullvm"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.52.6"
|
version = "0.52.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_msvc"
|
|
||||||
version = "0.53.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wit-bindgen-rt"
|
name = "wit-bindgen-rt"
|
||||||
version = "0.39.0"
|
version = "0.39.0"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ members = ["crates/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.2"
|
version = "0.0.6"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
noil = { path = "crates/noil" }
|
noil = { path = "crates/noil" }
|
||||||
|
|||||||
63
README.md
63
README.md
@@ -1,11 +1,8 @@
|
|||||||
# noil
|
# noil
|
||||||
|
|
||||||
**noil** is a structured, text-buffer-based file operation tool – think of it
|
**noil** is a structured, text-buffer-based file operation tool – think of it like [`oil.nvim`](https://github.com/stevearc/oil.nvim), but for any editor, terminal, or automated process.
|
||||||
like [`oil.nvim`](https://github.com/stevearc/oil.nvim), but for any editor,
|
|
||||||
terminal, or automated process.
|
|
||||||
|
|
||||||
Edit filesystem operations like it's plain text, and then apply them in a
|
Edit filesystem operations like it's plain text, and then apply them in a controlled, explicit way.
|
||||||
controlled, explicit way.
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -13,19 +10,17 @@ controlled, explicit way.
|
|||||||
|
|
||||||
## Interactive Mode (TBA)
|
## Interactive Mode (TBA)
|
||||||
|
|
||||||
I am planning an interactive TUI mode, where you don't have to care about tags,
|
I am planning an interactive TUI mode, where you don't have to care about tags, like in `oil`. For now the normal editor is quite useful though, and allows all types of editors to easily move, edit files and so on.
|
||||||
like in `oil`. For now the normal editor is quite useful though, and allows all
|
|
||||||
types of editors to easily move, edit files and so on.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- Edit your file tree like a normal buffer
|
* Edit your file tree like a normal buffer
|
||||||
- Preview, format, and apply changes
|
* Preview, format, and apply changes
|
||||||
- Integrates with `$EDITOR`
|
* Integrates with `$EDITOR`
|
||||||
- CLI first, editor agnostic
|
* CLI first, editor agnostic
|
||||||
- No surprises: nothing is applied until you say so
|
* No surprises: nothing is applied until you say so
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -47,7 +42,7 @@ cat something.noil | noil fmt > something.noil
|
|||||||
cat something.noil | noil apply
|
cat something.noil | noil apply
|
||||||
```
|
```
|
||||||
|
|
||||||
noil will ask you if you want to apply your changes before doing any operations.
|
noil will always ask you if you want to apply your changes before doing any operations.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -62,13 +57,12 @@ Each line follows this format:
|
|||||||
### Supported operations:
|
### Supported operations:
|
||||||
|
|
||||||
| Operation | Meaning | Tag Required? |
|
| Operation | Meaning | Tag Required? |
|
||||||
| --------: | ------------------------------------------------------ | ------------- |
|
| --------: | --------------------------------- | ------------- |
|
||||||
| `ADD` | Add new file | ❌ No |
|
| `ADD` | Add new file | ❌ No |
|
||||||
| `COPY` | Copy file with given tag | ✅ Yes |
|
| `COPY` | Copy file with given tag | ✅ Yes |
|
||||||
| `DELETE` | Delete file with given tag | ✅ Yes |
|
| `DELETE` | Delete file with given tag | ✅ Yes |
|
||||||
| `MOVE` | Move file with given tag | ✅ Yes |
|
| `MOVE` | Move file with given tag | ✅ Yes |
|
||||||
| `OPEN` | Open a file with a given tag (requires --chooser-file) | ❌ No |
|
| *(blank)* | Reference existing file (default) | ✅ Yes |
|
||||||
| _(blank)_ | Reference existing file (default) | ✅ Yes |
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -79,11 +73,9 @@ Each line follows this format:
|
|||||||
COPY abc : /tmp/nginx-copy
|
COPY abc : /tmp/nginx-copy
|
||||||
DELETE 123 : /etc/nginx
|
DELETE 123 : /etc/nginx
|
||||||
ADD : /new/file.txt
|
ADD : /new/file.txt
|
||||||
OPEN : /new/file.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use short, unique tags (like `abc`, `ng1`, etc.) to refer to files.
|
You can use short, unique tags (like `abc`, `ng1`, etc.) to refer to files. `noil` will generate these tags when you run `noil .`.
|
||||||
`noil` will generate these tags when you run `noil .`.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -95,11 +87,9 @@ Want to clean up alignment and spacing?
|
|||||||
cat my-buffer.noil | noil fmt
|
cat my-buffer.noil | noil fmt
|
||||||
```
|
```
|
||||||
|
|
||||||
Or automatically format inside your editor with the following config for
|
Or automatically format inside your editor with the following config for [Helix](https://helix-editor.com):
|
||||||
[Helix](https://helix-editor.com):
|
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# .config/helix/languages.toml
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "noil"
|
name = "noil"
|
||||||
scope = "source.noil"
|
scope = "source.noil"
|
||||||
@@ -112,30 +102,8 @@ formatter = { command = "noil", args = ["fmt"] }
|
|||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "noil"
|
name = "noil"
|
||||||
source = { git = "https://git.kjuulh.io/kjuulh/tree-sitter-noil.git", rev = "2f295629439881d0b9e89108a1296881d0daf7b9" }
|
source = { git = "https://git.kjuulh.io/kjuulh/tree-sitter-noil.git", rev = "2f295629439881d0b9e89108a1296881d0daf7b9" }
|
||||||
|
|
||||||
# .config/helix/config.toml
|
|
||||||
# Optional extra command Space + o will open noil allowing edits and the OPEN command
|
|
||||||
[keys.normal.space]
|
|
||||||
o = [
|
|
||||||
":sh rm -f /tmp/unique-file-kjuulh",
|
|
||||||
# DISCLAIMER: Until noil has a proper interactive mode, we cannot ask for confirmation, as such we always commit changes, you don't get to have a preview unlike the normal cli option
|
|
||||||
":insert-output noil edit '%{buffer_name}' --chooser-file=/tmp/unique-file-kjuulh --commit --quiet < /dev/tty",
|
|
||||||
":insert-output echo \"x1b[?1049h\" > /dev/tty",
|
|
||||||
":open %sh{cat /tmp/unique-file-kjuulh}",
|
|
||||||
":redraw",
|
|
||||||
]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Edit options
|
|
||||||
|
|
||||||
When using `noil edit .` a few additional options are available
|
|
||||||
|
|
||||||
- `--chooser-file`: A chooser file is a newline delimited file where each line
|
|
||||||
corresponds to a relative file to be opened or manipulated by the user. Only
|
|
||||||
items with `OPEN` command will be added to the file
|
|
||||||
- `--commit`: commit files without asking for confirmation
|
|
||||||
- `--quiet`: don't print results
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 🔒 Safety First
|
## 🔒 Safety First
|
||||||
@@ -155,9 +123,7 @@ You will be prompted before anything is modified.
|
|||||||
|
|
||||||
## 🧠 Philosophy
|
## 🧠 Philosophy
|
||||||
|
|
||||||
noil gives you full control over file operations in a composable and
|
noil gives you full control over file operations in a composable and editor-friendly way. Think Git index, but for actual file moves and deletions — human-editable, patchable, and grep-able.
|
||||||
editor-friendly way. Think Git index, but for actual file moves and deletions —
|
|
||||||
human-editable, patchable, and grep-able.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -169,6 +135,7 @@ human-editable, patchable, and grep-able.
|
|||||||
cargo install noil
|
cargo install noil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
**Build from source**:
|
**Build from source**:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ ignore = "0.4.23"
|
|||||||
blake3 = "1.8.2"
|
blake3 = "1.8.2"
|
||||||
rand = "0.9.2"
|
rand = "0.9.2"
|
||||||
ansi_term = "0.12.1"
|
ansi_term = "0.12.1"
|
||||||
shellexpand = "3.1.1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pretty_assertions = "1.4.1"
|
pretty_assertions = "1.4.1"
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
cli::edit::{ApplyOptions, apply},
|
cli::edit::apply,
|
||||||
commit::{Action, print_changes},
|
commit::{Action, print_changes},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -11,9 +9,6 @@ use crate::{
|
|||||||
pub struct ApplyCommand {
|
pub struct ApplyCommand {
|
||||||
#[arg(long = "commit")]
|
#[arg(long = "commit")]
|
||||||
commit: bool,
|
commit: bool,
|
||||||
|
|
||||||
#[arg(long = "chooser-file", env = "NOIL_CHOOSER_FILE")]
|
|
||||||
chooser_file: Option<PathBuf>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ApplyCommand {
|
impl ApplyCommand {
|
||||||
@@ -29,16 +24,7 @@ impl ApplyCommand {
|
|||||||
let action = print_changes(&input, !self.commit).await?;
|
let action = print_changes(&input, !self.commit).await?;
|
||||||
let res = match action {
|
let res = match action {
|
||||||
Action::Quit => Ok(()),
|
Action::Quit => Ok(()),
|
||||||
Action::Apply { original } => {
|
Action::Apply { original } => apply(&original).await,
|
||||||
apply(
|
|
||||||
&original,
|
|
||||||
ApplyOptions {
|
|
||||||
chooser_file: self.chooser_file.clone(),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
Action::Edit => todo!(),
|
Action::Edit => todo!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -46,14 +32,7 @@ impl ApplyCommand {
|
|||||||
|
|
||||||
res
|
res
|
||||||
} else {
|
} else {
|
||||||
apply(
|
apply(&input).await
|
||||||
&input,
|
|
||||||
ApplyOptions {
|
|
||||||
chooser_file: self.chooser_file.clone(),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
use std::{
|
use std::{
|
||||||
env::temp_dir,
|
env::temp_dir,
|
||||||
io::{IsTerminal, Write},
|
io::Write,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::Stdio,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use ansi_term::Color;
|
use ansi_term::Color;
|
||||||
use anyhow::{Context, bail};
|
use anyhow::{Context, bail};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use tokio::{
|
use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader};
|
||||||
fs::OpenOptions,
|
|
||||||
io::{AsyncBufReadExt, AsyncWriteExt, BufReader},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
commit::{Action, print_changes},
|
commit::{Action, print_changes},
|
||||||
@@ -27,26 +23,14 @@ const PREVIEW: bool = false;
|
|||||||
pub struct EditCommand {
|
pub struct EditCommand {
|
||||||
#[arg()]
|
#[arg()]
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
|
|
||||||
#[arg(long = "chooser-file", env = "NOIL_CHOOSER_FILE")]
|
|
||||||
chooser_file: Option<PathBuf>,
|
|
||||||
|
|
||||||
#[arg(long = "commit")]
|
|
||||||
commit: bool,
|
|
||||||
|
|
||||||
#[arg(long = "quiet")]
|
|
||||||
quiet: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EditCommand {
|
impl EditCommand {
|
||||||
pub async fn execute(&self) -> anyhow::Result<()> {
|
pub async fn execute(&self) -> anyhow::Result<()> {
|
||||||
let mut small_id = Vec::new();
|
let mut small_id = Vec::with_capacity(8);
|
||||||
|
for id in small_id.iter_mut() {
|
||||||
for _ in 0..8 {
|
*id = encode_rand::ALPHABET
|
||||||
small_id.push(
|
[rand::random_range(0..(encode_rand::ALPHABET_LEN as u8)) as usize];
|
||||||
encode_rand::ALPHABET
|
|
||||||
[rand::random_range(0..(encode_rand::ALPHABET_LEN as u8)) as usize],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
let small_id = String::from_utf8_lossy(&small_id);
|
let small_id = String::from_utf8_lossy(&small_id);
|
||||||
|
|
||||||
@@ -65,24 +49,9 @@ impl EditCommand {
|
|||||||
.await
|
.await
|
||||||
.context("create temp file for noil")?;
|
.context("create temp file for noil")?;
|
||||||
|
|
||||||
let path = &self
|
let output = get_outputs(&self.path, true).await?;
|
||||||
.get_path()
|
file.write_all(output.as_bytes()).await?;
|
||||||
.await
|
file.flush().await?;
|
||||||
.context("get path")
|
|
||||||
.inspect_err(|e| {
|
|
||||||
tracing::warn!(
|
|
||||||
"error: file path doesn't exist, defaulting to current working dir: {e}"
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.unwrap_or_else(|_| PathBuf::from("."));
|
|
||||||
|
|
||||||
let output = get_outputs(path, true)
|
|
||||||
.await
|
|
||||||
.context(format!("get output: {}", path.display()))?;
|
|
||||||
file.write_all(output.as_bytes())
|
|
||||||
.await
|
|
||||||
.context("write contents for edit")?;
|
|
||||||
file.flush().await.context("flush contents for edit")?;
|
|
||||||
|
|
||||||
let editor = std::env::var("EDITOR").context("EDITOR not found in env")?;
|
let editor = std::env::var("EDITOR").context("EDITOR not found in env")?;
|
||||||
|
|
||||||
@@ -90,22 +59,7 @@ impl EditCommand {
|
|||||||
let mut cmd = tokio::process::Command::new(editor.trim());
|
let mut cmd = tokio::process::Command::new(editor.trim());
|
||||||
cmd.arg(&file_path);
|
cmd.arg(&file_path);
|
||||||
|
|
||||||
if !std::io::stdout().is_terminal() {
|
let mut process = cmd.spawn()?;
|
||||||
let tty = OpenOptions::new()
|
|
||||||
.read(true)
|
|
||||||
.write(true)
|
|
||||||
.open("/dev/tty")
|
|
||||||
.await
|
|
||||||
.context("open tty")?;
|
|
||||||
let tty_in = tty.try_clone().await.context("clone ttyin")?;
|
|
||||||
let tty_out = tty.try_clone().await.context("clone ttyout")?;
|
|
||||||
|
|
||||||
cmd.stdin(Stdio::from(tty_in.into_std().await))
|
|
||||||
.stdout(Stdio::from(tty_out.into_std().await))
|
|
||||||
.stderr(Stdio::from(tty.into_std().await));
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut process = cmd.spawn().context("command not found")?;
|
|
||||||
let status = process.wait().await.context("editor closed prematurely")?;
|
let status = process.wait().await.context("editor closed prematurely")?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
let code = status.code().unwrap_or(-1);
|
let code = status.code().unwrap_or(-1);
|
||||||
@@ -116,13 +70,7 @@ impl EditCommand {
|
|||||||
.await
|
.await
|
||||||
.context("read noil file")?;
|
.context("read noil file")?;
|
||||||
|
|
||||||
let res = if !self.commit {
|
let res = print_changes(&noil_content, PREVIEW).await;
|
||||||
print_changes(&noil_content, PREVIEW).await
|
|
||||||
} else {
|
|
||||||
Ok(Action::Apply {
|
|
||||||
original: noil_content,
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
let action = match res {
|
let action = match res {
|
||||||
Ok(a) => a,
|
Ok(a) => a,
|
||||||
@@ -132,7 +80,7 @@ impl EditCommand {
|
|||||||
Color::Red.normal().paint(format!("{e:?}"))
|
Color::Red.normal().paint(format!("{e:?}"))
|
||||||
);
|
);
|
||||||
|
|
||||||
wait_user().await.context("user finished prematurely")?;
|
wait_user().await?;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -141,44 +89,12 @@ impl EditCommand {
|
|||||||
match action {
|
match action {
|
||||||
Action::Quit => return Ok(()),
|
Action::Quit => return Ok(()),
|
||||||
Action::Apply { original } => {
|
Action::Apply { original } => {
|
||||||
return apply(
|
return apply(&original).await;
|
||||||
&original,
|
|
||||||
ApplyOptions {
|
|
||||||
chooser_file: self.chooser_file.clone(),
|
|
||||||
quiet: self.quiet,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
}
|
}
|
||||||
Action::Edit => continue,
|
Action::Edit => continue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_path(&self) -> anyhow::Result<PathBuf> {
|
|
||||||
let path_str = self.path.display().to_string();
|
|
||||||
let expanded_path = shellexpand::full(&path_str)?;
|
|
||||||
let path = PathBuf::from(expanded_path.to_string());
|
|
||||||
|
|
||||||
if !path.exists() {
|
|
||||||
anyhow::bail!("path: {} does not exist", self.path.display());
|
|
||||||
}
|
|
||||||
|
|
||||||
if path.is_file() {
|
|
||||||
let parent_path = path
|
|
||||||
.parent()
|
|
||||||
.map(|p| p.to_path_buf())
|
|
||||||
.ok_or(anyhow::anyhow!("parent doesn't exist for file"))?;
|
|
||||||
|
|
||||||
if parent_path.display().to_string() == "" {
|
|
||||||
return Ok(PathBuf::from("."));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(parent_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(path.clone())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn wait_user() -> Result<(), anyhow::Error> {
|
async fn wait_user() -> Result<(), anyhow::Error> {
|
||||||
@@ -187,19 +103,10 @@ async fn wait_user() -> Result<(), anyhow::Error> {
|
|||||||
let stdin = tokio::io::stdin();
|
let stdin = tokio::io::stdin();
|
||||||
let mut reader = BufReader::new(stdin);
|
let mut reader = BufReader::new(stdin);
|
||||||
let mut input_buf = String::new();
|
let mut input_buf = String::new();
|
||||||
reader
|
reader.read_line(&mut input_buf).await?;
|
||||||
.read_line(&mut input_buf)
|
|
||||||
.await
|
|
||||||
.context("failed to read stdin")?;
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Clone, Debug)]
|
|
||||||
pub struct ApplyOptions {
|
|
||||||
pub chooser_file: Option<PathBuf>,
|
|
||||||
pub quiet: bool,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// the philosphy behind apply is that we try unlike normal file system operations to be idempotent.
|
/// the philosphy behind apply is that we try unlike normal file system operations to be idempotent.
|
||||||
/// This is mainly for 2 reasons.
|
/// This is mainly for 2 reasons.
|
||||||
///
|
///
|
||||||
@@ -207,29 +114,17 @@ pub struct ApplyOptions {
|
|||||||
/// 2. A .noil recipe can be rerun, having small issues disrupt the work would be counterproductive, as the .noil language is not powerful enough to handle the flexibility required for file checking
|
/// 2. A .noil recipe can be rerun, having small issues disrupt the work would be counterproductive, as the .noil language is not powerful enough to handle the flexibility required for file checking
|
||||||
///
|
///
|
||||||
/// All in all apply is mostly idempotent, and won't override files, it tries to be as non destructive as possible. For example move will only throw a warning if the source file doesn't exists, but the destination does
|
/// All in all apply is mostly idempotent, and won't override files, it tries to be as non destructive as possible. For example move will only throw a warning if the source file doesn't exists, but the destination does
|
||||||
pub async fn apply(input: &str, options: ApplyOptions) -> anyhow::Result<()> {
|
pub async fn apply(input: &str) -> anyhow::Result<()> {
|
||||||
if !options.quiet {
|
|
||||||
eprintln!("applying changes");
|
eprintln!("applying changes");
|
||||||
}
|
|
||||||
|
|
||||||
let noil_index = parse::parse_input(input).context("parse input")?;
|
let noil_index = parse::parse_input(input).context("parse input")?;
|
||||||
|
|
||||||
let mut open_files = Vec::new();
|
|
||||||
|
|
||||||
for file in &noil_index.files {
|
for file in &noil_index.files {
|
||||||
let path = &file.path;
|
let path = &file.path;
|
||||||
match &file.entry.operation {
|
match &file.entry.operation {
|
||||||
Operation::Existing { .. } => {
|
Operation::Existing { .. } => {
|
||||||
// Noop
|
// Noop
|
||||||
}
|
}
|
||||||
Operation::Open { .. } => {
|
|
||||||
if path.to_string_lossy().ends_with("/") {
|
|
||||||
// We can't open directories, so they're skipped
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
open_files.push(path);
|
|
||||||
}
|
|
||||||
Operation::Add => {
|
Operation::Add => {
|
||||||
tracing::debug!("creating file");
|
tracing::debug!("creating file");
|
||||||
|
|
||||||
@@ -328,14 +223,6 @@ pub async fn apply(input: &str, options: ApplyOptions) -> anyhow::Result<()> {
|
|||||||
anyhow::bail!("destination already exists cannot move");
|
anyhow::bail!("destination already exists cannot move");
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(parent) = existing.path.parent()
|
|
||||||
&& !parent.exists()
|
|
||||||
{
|
|
||||||
tokio::fs::create_dir_all(&parent)
|
|
||||||
.await
|
|
||||||
.context("failed to create dest for move")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
tokio::fs::rename(&existing.path, path)
|
tokio::fs::rename(&existing.path, path)
|
||||||
.await
|
.await
|
||||||
.context("move path")?;
|
.context("move path")?;
|
||||||
@@ -343,31 +230,6 @@ pub async fn apply(input: &str, options: ApplyOptions) -> anyhow::Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(chooser_file) = &options.chooser_file {
|
|
||||||
tracing::debug!("creating chooser file");
|
|
||||||
if let Some(parent) = chooser_file.parent()
|
|
||||||
&& !chooser_file.exists()
|
|
||||||
{
|
|
||||||
tokio::fs::create_dir_all(parent)
|
|
||||||
.await
|
|
||||||
.context("parent dir for chooser file")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut file = tokio::fs::File::create(chooser_file)
|
|
||||||
.await
|
|
||||||
.context("create new chooser file")?;
|
|
||||||
|
|
||||||
let open_files = open_files
|
|
||||||
.iter()
|
|
||||||
.map(|i| i.display().to_string())
|
|
||||||
.collect::<Vec<_>>();
|
|
||||||
|
|
||||||
file.write_all(open_files.join(" ").as_bytes())
|
|
||||||
.await
|
|
||||||
.context("write chosen files")?;
|
|
||||||
file.flush().await.context("flush chosen file")?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,6 @@ pub(crate) fn format(input: &str) -> anyhow::Result<String> {
|
|||||||
| models::Operation::Delete { index }
|
| models::Operation::Delete { index }
|
||||||
| models::Operation::Move { index }
|
| models::Operation::Move { index }
|
||||||
| models::Operation::Existing { index } => index.len(),
|
| models::Operation::Existing { index } => index.len(),
|
||||||
models::Operation::Open { index } => {
|
|
||||||
index.as_ref().map(|i| i.len()).unwrap_or_default()
|
|
||||||
}
|
|
||||||
models::Operation::Add => 0,
|
models::Operation::Add => 0,
|
||||||
})
|
})
|
||||||
.max()
|
.max()
|
||||||
@@ -56,7 +53,6 @@ pub(crate) fn format(input: &str) -> anyhow::Result<String> {
|
|||||||
| models::Operation::Delete { index }
|
| models::Operation::Delete { index }
|
||||||
| models::Operation::Move { index }
|
| models::Operation::Move { index }
|
||||||
| models::Operation::Existing { index } => Some(index),
|
| models::Operation::Existing { index } => Some(index),
|
||||||
models::Operation::Open { index } => index,
|
|
||||||
models::Operation::Add => None,
|
models::Operation::Add => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ pub enum Operation {
|
|||||||
Copy { index: String },
|
Copy { index: String },
|
||||||
Delete { index: String },
|
Delete { index: String },
|
||||||
Move { index: String },
|
Move { index: String },
|
||||||
Open { index: Option<String> },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Operation {
|
impl Display for Operation {
|
||||||
@@ -46,7 +45,6 @@ impl Display for Operation {
|
|||||||
Operation::Copy { .. } => "COPY",
|
Operation::Copy { .. } => "COPY",
|
||||||
Operation::Delete { .. } => "DELETE",
|
Operation::Delete { .. } => "DELETE",
|
||||||
Operation::Move { .. } => "MOVE",
|
Operation::Move { .. } => "MOVE",
|
||||||
Operation::Open { .. } => "OPEN",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
f.write_str(op)
|
f.write_str(op)
|
||||||
@@ -88,16 +86,6 @@ impl FileEntry {
|
|||||||
"D" | "DEL" | "DELETE" if first != last => Operation::Delete { index },
|
"D" | "DEL" | "DELETE" if first != last => Operation::Delete { index },
|
||||||
// MOVE:
|
// MOVE:
|
||||||
"M" | "MV" | "MOVE" | "RENAME" if first != last => Operation::Move { index },
|
"M" | "MV" | "MOVE" | "RENAME" if first != last => Operation::Move { index },
|
||||||
"O" | "OPEN" => Operation::Open {
|
|
||||||
index: {
|
|
||||||
// if LAST == is the Operation, we set the index to empty, if the index is missing we set it to None
|
|
||||||
if index.is_empty() || index.chars().any(|c| c.is_uppercase()) {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(index)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
o => {
|
o => {
|
||||||
anyhow::bail!("operation: {} is not supported", o);
|
anyhow::bail!("operation: {} is not supported", o);
|
||||||
}
|
}
|
||||||
@@ -206,60 +194,6 @@ ADD : /var/my/path/new-long-path
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn can_parse_item_open_operation() -> anyhow::Result<()> {
|
|
||||||
let input = r#"
|
|
||||||
O abc : /var/my
|
|
||||||
OPEN ecd : /var/my/path
|
|
||||||
O : /var/my/path/new-path
|
|
||||||
OPEN : /var/my/path/new-long-path
|
|
||||||
"#;
|
|
||||||
|
|
||||||
let output = parse::parse_input(input)?;
|
|
||||||
|
|
||||||
pretty_assertions::assert_eq!(
|
|
||||||
Buffer {
|
|
||||||
files: vec![
|
|
||||||
File {
|
|
||||||
path: "/var/my".into(),
|
|
||||||
entry: FileEntry {
|
|
||||||
raw_op: Some("O".into()),
|
|
||||||
operation: Operation::Open {
|
|
||||||
index: Some("abc".into()),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
File {
|
|
||||||
path: "/var/my/path".into(),
|
|
||||||
entry: FileEntry {
|
|
||||||
raw_op: Some("OPEN".into()),
|
|
||||||
operation: Operation::Open {
|
|
||||||
index: Some("ecd".into())
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
File {
|
|
||||||
path: "/var/my/path/new-path".into(),
|
|
||||||
entry: FileEntry {
|
|
||||||
raw_op: Some("O".into()),
|
|
||||||
operation: Operation::Open { index: None },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
File {
|
|
||||||
path: "/var/my/path/new-long-path".into(),
|
|
||||||
entry: FileEntry {
|
|
||||||
raw_op: Some("OPEN".into()),
|
|
||||||
operation: Operation::Open { index: None },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
output
|
|
||||||
);
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_parse_item_copy_operation() -> anyhow::Result<()> {
|
fn can_parse_item_copy_operation() -> anyhow::Result<()> {
|
||||||
let input = r#"
|
let input = r#"
|
||||||
|
|||||||
15
templates/docker-compose.yaml
Normal file
15
templates/docker-compose.yaml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
crdb:
|
||||||
|
restart: 'always'
|
||||||
|
image: 'cockroachdb/cockroach:v23.1.14'
|
||||||
|
command: 'start-single-node --advertise-addr 0.0.0.0 --insecure'
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health?ready=1"]
|
||||||
|
interval: '10s'
|
||||||
|
timeout: '30s'
|
||||||
|
retries: 5
|
||||||
|
start_period: '20s'
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
- '26257:26257'
|
||||||
Reference in New Issue
Block a user