Skip to content

Commit

Permalink
Merge pull request #26 from CCBR/fix-cli-citation
Browse files Browse the repository at this point in the history
Fix cli citation flag
  • Loading branch information
dnousome authored Jan 10, 2024
2 parents e7bc934 + cbf9b8f commit f70ffa1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cff-version: 1.2.0
message: "Please cite LOGAN as below." # TODO set up Zenodo to archive your tool and assign a DOI. Or if it gets published in a journal, include the citation here.
authors:
- family-names: Nousome
given-names: Darryl
- family-names: Sovacool
given-names: Kelly
orcid: https://orcid.org/0000-0003-3283-829X
- family-names: Koparde
given-names: Vishal
orcid: https://orcid.org/0000-0001-8978-8495
title: "LOGAN: whoLe genOme-sequencinG Analysis pipeliNe"
url: https://ccbr.github.io/LOGAN/
repository-code: https://github.com/CCBR/LOGAN
license: MIT
9 changes: 8 additions & 1 deletion src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ def common_options(func):
cls=OrderedCommands, context_settings=dict(help_option_names=["-h", "--help"])
)
@click.version_option(get_version(), "-v", "--version", is_flag=True)
@click.option("--citation", is_flag=True, callback=print_citation, expose_value=False, help="Print the citation in bibtex format and exit.")
@click.option(
"--citation",
is_flag=True,
callback=print_citation,
expose_value=False,
is_eager=True,
help="Print the citation in bibtex format and exit.",
)
def cli():
"""whoLe genOme-sequencinG Analysis pipeliNe
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 f70ffa1

Please sign in to comment.