mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Mention codemod -x flag in docs (#1169)
This commit is contained in:
parent
7bb00179d9
commit
72701e4b40
1 changed files with 4 additions and 2 deletions
|
|
@ -135,16 +135,18 @@ replaces any string which matches our string command-line argument with a consta
|
|||
It also takes care of adding the import required for the constant to be defined properly.
|
||||
|
||||
Cool! Let's look at the command-line help for this codemod. Let's assume you saved it
|
||||
as ``constant_folding.py`` inside ``libcst.codemod.commands``. You can get help for the
|
||||
as ``constant_folding.py``. You can get help for the
|
||||
codemod by running the following command::
|
||||
|
||||
python3 -m libcst.tool codemod constant_folding.ConvertConstantCommand --help
|
||||
python3 -m libcst.tool codemod -x constant_folding.ConvertConstantCommand --help
|
||||
|
||||
Notice that along with the default arguments, the ``--string`` and ``--constant``
|
||||
arguments are present in the help, and the command-line description has been updated
|
||||
with the codemod's description string. You'll notice that the codemod also shows up
|
||||
on ``libcst.tool list``.
|
||||
|
||||
And ``-x`` flag allows to load any module as a codemod in addition to the standard ones.
|
||||
|
||||
----------------
|
||||
Testing Codemods
|
||||
----------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue