forked from untergeek/es-fieldusage
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_script.py
More file actions
executable file
·24 lines (21 loc) · 765 Bytes
/
Copy pathrun_script.py
File metadata and controls
executable file
·24 lines (21 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
# pylint: disable=broad-except, no-value-for-parameter
"""
Wrapper for running the command-line script from an installed module.
Because this script is up one level from src, it has to find the module es_fieldusage.cli from
installed modules. This makes it a good way to ensure everything will work when installed.
To test development in progress, use the local_test.py script in src (and you must be in src to execute)
"""
import sys
import click
from es_fieldusage.cli import run
if __name__ == '__main__':
try:
run()
except RuntimeError as err:
click.echo(f'{err}')
sys.exit(1)
except Exception as err:
if 'ASCII' in str(err):
click.echo(f'{err}')
click.echo(__doc__)