5 ms·
> My only complaint is there are a couple of characters that the -F (treat as literal) option seems to still treat as a special character needing some kind of e
by burntsushi 1y ago
> My only complaint is there are a couple of characters that the -F (treat as literal) option seems to still treat as a special character needing some kind of escape - though I don't remember which ones now.
If you have an example, I can try to explain for that specific case. But `-F/--fixed-strings` will 100% turn off any regex features in the pattern and instead will be treated as a simple literal. Where you might still need escaping is if your shell requires it.
- echelon 1y agoTotally off-topic: what are the selling points of `jiff` vs chrono, time, std::time, etc.? Totally love your work! We've been sponsoring for awhile even though it isn't much. Thank you for all you do!
- burntsushi 1y agoHave you seen https://docs.rs/jiff/latest/jiff/_documentation/comparison/index.html https://docs.rs/jiff/latest/jiff/_documentation/comparison/i... and https://docs.rs/jiff/latest/jiff/_documentation/design/index.html https://docs.rs/jiff/latest/jiff/_documentation/design/index...? I'd be happy to answer more specific questions. Short opinionated summary is: nicer API, fewer footguns, more features, better support for calendar durations, integrated tzdb support and lots more to be honest. Note that `std::time` just gives you a platform independent but bare bones access to monotonic and system clocks. Some kind of datetime library is needed if you want to do anything with Unix timestamps beyond treat them as an integer.
- kator 1y agoripgrep has saved me so much time, I also use it now with LLMs and remind them they have ripgrep available! I added a donation on github, thanks for all your work.
- cormacrelf 1y agoHow about -F -regexthatlookslikeaflag? Verbatim, that errors out as the command line parsing tries to interpret it as a flag. If you don’t have -F, then you can escape the leading hyphen with a backslash in a single quoted string: '\-regex…', but then you don’t get fixed string search. And -F '\-regex…' is a fixed string search for “backslash hyphen r e g e x”. The only way is to manually escape the regex and not use -F. I think maybe a syntax like -F=-regex would work.
- burntsushi 1y agoYeah, that's a good call out. You would need `rg -F -e -pattern`.
- account42 1y agoThe convention is use use -- to denote the end of options in command-line tools - anything after that is parsed as a normal argument even if it starts with a dash. If rg doesn't support that it should.
- burntsushi 1y agoIt has since day 1. And you can use the `-e/--regexp` flag too, just like grep.