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

CLI: Use raw descriptions #1641

Draft
wants to merge 4 commits into
base: victorlin/argparse-register-commands
Choose a base branch
from

Commits on Sep 25, 2024

  1. curate: Set shared parser separately

    This is necessary to register subparsers recursively.
    victorlin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    3268812 View commit details
    Browse the repository at this point in the history
  2. Register subparsers recursively

    Keeps consistent with Nextstrain CLI.
    victorlin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    1b110b7 View commit details
    Browse the repository at this point in the history
  3. Get subparser formatter class from top-level parser

    Set a single source of truth.
    victorlin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    710f804 View commit details
    Browse the repository at this point in the history
  4. Preserve formatting of command descriptions

    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
    victorlin committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    dacddeb View commit details
    Browse the repository at this point in the history