-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find --modify trim breaks other options like line numbers and highlighting #79
Comments
Hi, thank you for your post. I thought about this issue for a some time and I think that, based on your feedback, I think that the best solution is to deprecate The comparison between "default" and default output:
Any feedback on the PR is welcome. |
Thanks for looking into this. I use this tool frequently. Huge caveat is that I'm not familiar with your code base or any of the decision points along the way, so I can only speak to it generally as a software architect. To me, this feels like an order of events problem. If it were me, this is the approach I would explore first. The
Frankly, I think you were heading down good paths with both the Then you're faced with another ordering problem with the Modify step. For example, let's say the user wants to trim leading whitespace and wants to perform a replacement. Do you first perform the trim, and then the replacement, or vice versa? In some cases, the order may not matter, but sometimes it very much will (depending on the available modifications). The easiest approach here is to perform them in the order provided by the user. Maybe something like this:
You get a ton of flexibility out of this design, and it's easily understood what will happen. My opinion is clearly biased. ha ha IIRC, you have options for distinct, aggregate, etc. I didn't cover that here because I wanted to keep it as simple as possible while still demonstrating how it solves the original problem, as well as others. Regardless, that is another class of operation, so it would have to be another number inserted into the order listed above. It's not a display, sort nor a modify operation; therefore, it stands on its own. If I were to implement this, I would start with the command line parsing and representation of the options/arguments. Then I would ensure they were executed in the required order. Then I would do one option at a time and try to deliver value in small incremental chunks. Hope this helps! Like I said - I use this tool frequently, so great work on this!!! Happy to talk through it more if you want. I enjoy problems like this. |
First of all, I'm really glad that you use this tool and that you bring the user experience. Let me to add some comments to your command:
tl;dr This command should be
|
I think the really the most important question regarding Over the time I found out that I use pretty much only Current State
It's questionable what is the usefulness of modifying each match in the results. And if you really need to do it you can do it with
These options are sometime confusing even to me. The original intent was to give a user ability to display results by file and then display modified list of results. I'm in favor of removing these options.
Desired StateI would say that the desired state is to remove from
Next step to makes things clearer is to always display just a list of matches when using From the compatibility perspective it's better to introduce a new option (like Use other tool to post-process resultsIf you use
Real UsageI would love to know if you have some real use case that would not be covered by the proposed solution. If you post it here we can find some solution to it. |
Version Used:
0.5.0.0
Steps to Reproduce:
Create a new file
SearchMe.test
with the following content:Run the following commands to see the difference:
Actual Behavior:
Line numbers and highlighted matches are removed when using
--modify trim
Expected Behavior:
Using
--modify trim
should not break other functionality. Documentation says it should only remove whitespace, but it is much more destructive with the output. The--display
option is deprecated and shows that message every time you use it, without an option to suppress the deprecation message (at least none that I could find).The text was updated successfully, but these errors were encountered: