Skip to content

Commit a4691bf

Browse files
committed
revert username changes for simplicity
1 parent a6326b9 commit a4691bf

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

docs/tutorial/arguments/help.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,21 @@ NAME
159159

160160
But you can customize it with the `metavar` parameter for `typer.Argument()`.
161161

162-
For example, let's say you don't want to have the default of `NAME`, you want to display it as `user`, in lowercase, and you really want ✨ emojis ✨ everywhere:
162+
For example, let's say you don't want to have the default of `NAME`, you want to have `username`, in lowercase, and you really want ✨ emojis ✨ everywhere:
163163

164164
{* docs_src/arguments/help/tutorial006_an_py310.py hl[9] *}
165165

166-
Now the generated help text will have `user` instead of `NAME`:
166+
Now the generated help text will have `username` instead of `NAME`:
167167

168168
<div class="termy">
169169

170170
```console
171171
$ python main.py --help
172172

173-
Usage: main.py [OPTIONS] [✨user✨]
173+
Usage: main.py [OPTIONS] [✨username✨]
174174

175175
Arguments:
176-
[✨user✨] [default: World]
176+
[✨username✨] [default: World]
177177

178178
Options:
179179
--help Show this message and exit.

docs_src/arguments/help/tutorial006_an_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@app.command()
9-
def main(name: Annotated[str, typer.Argument(metavar="✨user✨")] = "World"):
9+
def main(name: Annotated[str, typer.Argument(metavar="✨username✨")] = "World"):
1010
print(f"Hello {name}")
1111

1212

docs_src/arguments/help/tutorial006_py310.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
@app.command()
7-
def main(name: str = typer.Argument("World", metavar="✨user✨")):
7+
def main(name: str = typer.Argument("World", metavar="✨username✨")):
88
print(f"Hello {name}")
99

1010

tests/test_tutorial/test_arguments/test_help/test_tutorial006.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@ def get_app(mod: ModuleType, request: pytest.FixtureRequest) -> typer.Typer:
4040
def test_help(app):
4141
result = runner.invoke(app, ["--help"])
4242
assert result.exit_code == 0
43-
assert "Usage: main [OPTIONS] [✨user✨]" in result.output
43+
assert "Usage: main [OPTIONS] [✨username✨]" in result.output
4444
assert "Arguments" in result.output
45-
assert "name" not in result.output
4645
assert "[default: World]" in result.output
4746

4847

0 commit comments

Comments
 (0)