made output pipeable hopefully, added 'pretty' option for 'get' in CLI
This commit is contained in:
2
setup.py
2
setup.py
@@ -6,7 +6,7 @@ with open('README.md') as file:
|
||||
|
||||
setup(
|
||||
name="tatt",
|
||||
version="0.953",
|
||||
version="0.954",
|
||||
py_modules=['tatt'],
|
||||
url='https://github.com/zevaverbach/tatt',
|
||||
install_requires=[
|
||||
|
||||
@@ -15,11 +15,14 @@ def cli():
|
||||
|
||||
@cli.command()
|
||||
@click.option('-s', '--save', is_flag=True, help='save to file')
|
||||
@click.option('-p', '--pretty', is_flag=True,
|
||||
help='pretty print, will make output non-pipeable')
|
||||
@click.argument('name')
|
||||
def get(name, save):
|
||||
"""Downloads and/or saves completed transcript."""
|
||||
try:
|
||||
transcript = json.dumps(helpers.get_transcript(name), indent=4)
|
||||
transcript = json.dumps(helpers.get_transcript(name),
|
||||
indent=4 if pretty else None)
|
||||
except exceptions.DoesntExistError:
|
||||
raise click.ClickException(f'no such transcript {name}')
|
||||
except exceptions.NotAvailable as e:
|
||||
|
||||
Reference in New Issue
Block a user