Skip to content

Commit

Permalink
more developer friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
meren committed Aug 23, 2023
1 parent 81b8c13 commit 22bf0e9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions anvio/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,20 @@ def __init__(self, description="No description :/", epilog=None):
def get_anvio_epilogue(self):
"""Function that formats the additional message that appears at the end of help."""

# Here we intend to collect the requires and provides statements from anvi'o programs.
# but the recovery of this 'epilogue' will yield an error for scripts that are not listed
# in the $PATH, which can happen during the earlier stages of program development. so,
# if we can't recover the epilogue, we go long hair don't care and return none.
try:
epilog = self.get_requires_and_provides_statements_for_program()
except:
return None

version = anvio.anvio_version_for_help_docs

general_help = f"https://merenlab.org/software/anvio/help/{version}"
program_help = f"{general_help}/programs/{self.prog}"

# starting with the requires / provides statements
epilog = self.get_requires_and_provides_statements_for_program()

if os.path.exists(os.path.join(os.path.dirname(docs.__file__), f"programs/{self.prog}.md")):
if atty:
epilog += f'''\n🍺 {attr('bold')}More on `{self.prog}`:{attr('reset')}\n\n {fg('cyan') + program_help + attr('reset')}'''
Expand Down

0 comments on commit 22bf0e9

Please sign in to comment.