adding --names option to the list command

This commit is contained in:
evilchili
2023-11-25 17:27:43 -05:00
parent 27e64af308
commit 15703c1fa1
2 changed files with 31 additions and 15 deletions
+5 -2
View File
@@ -74,9 +74,12 @@ def names(
@app.command()
def list():
def list(names: bool = typer.Option(False, help="Display sample names.")):
for lang, module in supported_languages.items():
text = textwrap.shorten(module.Language.text(count=20), width=70, placeholder='')
if names:
text = str(module.Name)
else:
text = textwrap.shorten(module.Language.text(count=20), width=70, placeholder='')
print(f"{lang.title():15s}: {text}")