-
Notifications
You must be signed in to change notification settings - Fork 64
Conversation
lg2m mostly. can you also update docs/source/cli.rst? I missed that in #29 |
### Using with `grep`/`git grep` to find files | ||
|
||
```bash | ||
grep -l <search> | xargs undebt -p path/to/pattern.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably add an example which uses find:
find -name '*.js' | xargs grep -l ... | xargs undebt ...
(or a more robust solution with either -print0
+ -0
or the ugly -exec
syntax)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was working out one with -exec
(did not think to use xargs
+ grep
) to show this kind of thing, but good call.
@paiweilai yeah I'll update the docs |
@asottile @paiweilai updated. look good? |
@ajm188 I feel like the tips section really belongs in |
@evhub I can get behind that. But I think in that case, the README should have a link to the tips section in the docs, so people can easily find it. |
README has a link to cli.rst. We can add a sentence (something like: ... and tips for using undebt bla bla bla) and link to tips section. |
### Using `find` to limit to a particular extension | ||
|
||
```bash | ||
find . -name '*.js' | xargs grep -l <search-text> | xargs undebt -p <path-to-pattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find .
is more simply written as find
|
||
.. code-block:: bash | ||
|
||
grep -l <search-text> | xargs undebt -p <path-to-pattern> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my other comment appears to be lost. This command is useless without a glob such as grep -l ... **/*.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think I pushed a commit that marked the diff as old before I had a chance to read this. Fixing.
lg2m now |
Addresses #31