No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with
21 additions and
12 deletions
-
bin/etherpump
|
|
@ -1,9 +1,26 @@ |
|
|
|
#!/usr/bin/env python3 |
|
|
|
|
|
|
|
import os |
|
|
|
import sys |
|
|
|
from pathlib import Path |
|
|
|
|
|
|
|
from etherpump import __VERSION__ |
|
|
|
|
|
|
|
|
|
|
|
def subcommands(): |
|
|
|
"""List all sub-commands for the `--help` output.""" |
|
|
|
subcommands = [] |
|
|
|
|
|
|
|
all_files = os.listdir(Path().absolute() / 'etherpump' / 'commands') |
|
|
|
modules = filter(lambda file: not file.startswith('__'), all_files) |
|
|
|
|
|
|
|
for module in modules: |
|
|
|
name = module.split('.py')[0] |
|
|
|
subcommands.append(f' {name}') |
|
|
|
|
|
|
|
return '\n'.join(subcommands) |
|
|
|
|
|
|
|
|
|
|
|
usage = """ |
|
|
|
_ |
|
|
|
| | |
|
|
@ -18,23 +35,15 @@ Usage: |
|
|
|
|
|
|
|
where CMD could be: |
|
|
|
|
|
|
|
pull |
|
|
|
index |
|
|
|
dumpcsv |
|
|
|
gettext |
|
|
|
gethtml |
|
|
|
creatediffhtml |
|
|
|
list |
|
|
|
listauthors |
|
|
|
revisionscount |
|
|
|
showmeta |
|
|
|
html5tidy |
|
|
|
{} |
|
|
|
|
|
|
|
For more information on each command try: |
|
|
|
|
|
|
|
etherpump CMD --help |
|
|
|
|
|
|
|
""" |
|
|
|
""".format( |
|
|
|
subcommands() |
|
|
|
) |
|
|
|
|
|
|
|
try: |
|
|
|
cmd = sys.argv[1] |
|
|
|