Skip to content

Commit

Permalink
fix(cli): only print the citation if the flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Dec 19, 2023
1 parent c0e6325 commit 97eb275
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def common_options(func):
is_flag=True,
callback=print_citation,
expose_value=False,
is_eager=True,
help="Print the citation in bibtex format and exit.",
)
def cli():
Expand Down
2 changes: 2 additions & 0 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def get_version():


def print_citation(context, param, value):
if not value or context.resilient_parsing:
return
citation = create_citation(nek_base("CITATION.cff"), None)
# click.echo(citation._implementation.cffobj['message'])
validate_or_write_output(None, "bibtex", False, citation)
Expand Down

0 comments on commit 97eb275

Please sign in to comment.