Commit graph

64 commits

Author SHA1 Message Date
Gregory
687f3a5b14
Add support for limited replacements | #105 2021-02-15 16:14:43 -05:00
Gregory
2732a925e3
Move tests to replacer too 2021-02-10 21:57:32 -05:00
Gregory
675fc614f6
Extract replacer into own file 2021-02-10 21:55:32 -05:00
Gregory
495fa3ea9c
Implement recursive glob support
#62
2021-02-10 21:49:38 -05:00
Wes Roberts
ebeab6fdf0 Adds note about in-place file modification to --help output 2020-08-03 10:15:16 -04:00
Gregory
1014135f0e
Add empty-file check for memmep use in stdout
resolves #76
2020-05-04 14:42:30 -04:00
Greg
88e2d3ed6d
replace: isolate memmap from file errs 2020-04-22 16:54:13 -04:00
Greg
39c29b20cb
Ensure memmap source is not empty
resolves #74
2020-04-22 16:48:07 -04:00
Danny Mösch
c8022e292f
Fix #68: Do not write empty content to file (#71) 2020-04-10 17:39:02 -04:00
Greg
191af013dc
Merge branch 'master' of github.com:chmln/sd 2020-03-29 16:37:29 -04:00
Greg
1532f800c8
Misc cleanup 2020-03-29 16:37:24 -04:00
Gregory
3cd464cce9
Upgrade Azure Pipelines (#65)
* Update azure pipeline config

* iterate

* Depend on master

* Depend on master: take 2

* Depend on master: take 3

* cargo fmt

* Remove min rust version check

* Attempt to remove MSRV test

* Attempt to remove MSRV test: fix jobs template path

* Attempt to remove MSRV test: fix jobs template path

* Attempt to remove MSRV test: fix jobs template path
2020-03-18 20:15:52 -04:00
Greg
5c1d60474e
Minor tweaks 2020-02-24 11:12:17 -05:00
Greg
87491b4dc9
Let ^$ match lines by default
resolves #60
2020-01-25 16:36:41 -05:00
Greg
4d274210d3
Pretty-print error on termination 2019-12-30 16:21:56 -05:00
Greg
3bac3945c3
Use own Error type 2019-12-30 16:13:05 -05:00
Greg
9669815cda
cleanup 2019-12-09 13:59:38 -05:00
Greg
d13899dbf3
Remove deprecated flag and cleanup app.rs 2019-11-17 14:48:35 -05:00
Greg
fe5c1481b6
cleanup replacer construction 2019-11-17 14:41:11 -05:00
Greg
a88195bf92
Cleanup some replacement code 2019-11-17 12:33:31 -05:00
Greg
2edc696544
misc cleanup 2019-10-22 18:09:27 -04:00
crides
1a622ce1fd Add s flag to make . match newline 2019-07-24 09:41:22 +08:00
Greg
3e0a8e1747
Fix stdin replacement with no matches + memmap size
resolves #41, resolves #42
2019-06-18 22:56:41 -04:00
Greg
0328591bb1
rustfmt 2019-06-18 14:57:39 -04:00
Greg
f223fc8ce6
Drop mmap_source first 2019-06-18 14:49:52 -04:00
Greg
4982a6645c
Fix crash on Windows | resolves #37 2019-06-18 14:49:23 -04:00
Greg
29c80fd6d7
Set up manpage generation 2019-06-18 14:04:02 -04:00
Greg
696847c426
Generate completions 2019-06-17 23:22:10 -04:00
Greg
d225a9024e
rustfmt and cleanup 2019-06-16 16:02:31 -04:00
Robert-André Mauchin
4e9aa7ddf2 Convert str to bytes to call replacer.replace
Fix #39

Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com>
2019-06-16 20:55:24 +02:00
Greg
ab457f7c70
Pre-allocate proper buffer size for memmap.
Additionally:
- switch over to `std::borrow::Cow` in `replace` to avoid unnecessary allocations.
- handle all errors

Resolves #38
2019-06-16 12:31:19 -04:00
Greg
80d92bd237
Remove smart-casing, implement full-word replace 2019-06-16 02:49:10 -04:00
Greg
7160053060
Remove smart-case util check 2019-06-16 02:48:42 -04:00
Greg
5a2094f733
Deprecate --in-place, add --preview 2019-06-16 02:48:29 -04:00
Greg
abe7cbcfbd
has_matches() - use quicker method 2019-04-08 23:35:25 -04:00
Greg
c197fc231e
input.rs - cleanup 2019-04-07 11:32:16 -04:00
Greg
a83b321960
Implement Error::log 2019-04-07 11:31:16 -04:00
Greg
060b7bb8a4
mmap - rough version 2019-04-07 01:40:59 -04:00
Greg
3609d743c3
Preserve permissions; minor refactor
resolves #14
2019-03-01 16:43:42 -05:00
Greg
a2d8b7a9e1 Cleanup error handling 2019-02-22 17:47:06 -05:00
Erich Gubler
77a1415593 Add Windows support by swapping out the atomic_write crate with the atomicwrites crate 2019-01-23 12:53:49 -07:00
Greg
c4e5871668 In-place replacement - dont halt on invalid input 2019-01-13 00:35:04 -05:00
Greg
fb31a1b31b Add unescape tests + tweak literal mode behavior 2019-01-02 23:22:25 -05:00
Greg
20228b6fe3 Unescape replacement expression 2019-01-02 22:52:09 -05:00
Greg
9a8e8a5c2f Add some unit tests + tweak smart-case logic 2019-01-02 22:17:05 -05:00
Greg
e5f0cd4f7b Use regex to replace literals 2019-01-02 21:54:45 -05:00
Greg
effa0fce14 Disable unescaping 2019-01-02 20:54:54 -05:00
Greg
d2d36b9b0c Use copy-on-write strings + smart replace 2018-12-31 01:33:16 -05:00
Greg
b76218c62e tweak description for --in-place 2018-12-30 00:56:18 -05:00
Greg
0b6764fe08 Implement smart-case 2018-12-29 23:02:26 -05:00