Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli citation flag #26

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading