Skip to content

Commit

Permalink
Preserve formatting of command descriptions
Browse files Browse the repository at this point in the history
This is useful for commands such as `augur distance` which have
descriptions written in rST. The rST syntax is preserved and could be
removed with a custom formatter class (as done in Nextstrain CLI¹), but
simply using the built-in RawDescriptionHelpFormatter is an improvement
over the default behavior.

Note that this only applies to descriptions, not help text for options.

¹ https://github.com/nextstrain/cli/blob/d4a419626eb5dc64e6de08566e51c5b48814727d/nextstrain/cli/argparse.py#L53
  • Loading branch information
victorlin committed Sep 24, 2024
1 parent db29fe9 commit 7966c30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion augur/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def make_parser():
parser = argparse.ArgumentParser(
prog = "augur",
description = "Augur: A bioinformatics toolkit for phylogenetic analysis.",
formatter_class = argparse.ArgumentDefaultsHelpFormatter,
formatter_class = argparse.RawDescriptionHelpFormatter,
)

add_default_command(parser)
Expand Down

0 comments on commit 7966c30

Please sign in to comment.