[X] I'm @tiangolo or he asked me directly to create an issue here.
Issue Content
Show help items in order of definition, not alphabetically
For example:
import typer
app = typer.Typer()
@app.command()
def first(word: str | None = None):
"""
First declared command should show up first.
"""
print(f"first {word}")
@app.command()
def after(word: str | None = None):
"""
Last declared command should show up last, not alphabetically.
"""
print(f"after {word}")
This is the current output:
$ typer demo.py run --help
Usage: typer [PATH_OR_MODULE] run [OPTIONS] COMMAND [ARGS]...
Run the provided Typer app.
╭─ Options ────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────╮
│ after Last declared command should show up last, not alphabetically. │
│ first First declared command should show up first. │
╰──────────────────────────────────────────────────────────────────────────╯
This is the ideal output:
$ typer demo.py run --help
Usage: typer [PATH_OR_MODULE] run [OPTIONS] COMMAND [ARGS]...
Run the provided Typer app.
╭─ Options ────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────╮
│ first First declared command should show up first. │
│ after Last declared command should show up last, not alphabetically. │
╰──────────────────────────────────────────────────────────────────────────╯
Privileged issue
Issue Content
Show help items in order of definition, not alphabetically
For example:
This is the current output:
This is the ideal output: