Mention codemod -x flag in docs (#1169)

This commit is contained in:
Kirill Ignatev 2024-07-04 02:49:15 -04:00 committed by GitHub
parent 7bb00179d9
commit 72701e4b40
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
----------------