Skip to content

Commit

Permalink
Add --list-plugins option
Browse files Browse the repository at this point in the history
  • Loading branch information
wichert committed Feb 11, 2014
1 parent 0860205 commit 372c1e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lingua/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import polib
from lingua.extractors import get_extractor
from lingua.extractors.babel import register_babel_plugins
from lingua.extractors import EXTRACTORS
import lingua.extractors.python
import lingua.extractors.xml
import lingua.extractors.zcml
Expand Down Expand Up @@ -147,6 +148,8 @@ def main():
help='Add DIRECTORY to list of paths to check for input files')
parser.add_argument('file', nargs='*',
help='Source file to process')
parser.add_argument('--list-plugins', action='store_true',
help='List all known extraction plugins')
# Output options
parser.add_argument('-o', '--output', metavar='FILE',
default='messages.pot',
Expand Down Expand Up @@ -180,6 +183,12 @@ def main():

options = parser.parse_args()
register_babel_plugins()

if options.list_plugins:
for plugin in sorted(EXTRACTORS):
print(plugin)
return

catalog = create_catalog(options)

scanned = 0
Expand Down

0 comments on commit 372c1e2

Please sign in to comment.