Skip to content

Commit 914a25b

Browse files
committed
Rename
1 parent 6af5c59 commit 914a25b

10 files changed

Lines changed: 8 additions & 8 deletions

File tree

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Multi-File Applications
1+
# One File Per Command
22

33
When your CLI application grows, you can split it into multiple files and modules. This pattern helps maintain a clean and organized code structure.
44

@@ -39,7 +39,7 @@ Let's start implementing our CLI! We'll create the `version` module, the `main`
3939

4040
Let's start by creating the `version` module. This module will contain the `version` command.
4141

42-
{* docs_src/splitting_apps/version.py *}
42+
{* docs_src/one_file_per_command/version.py *}
4343

4444
In this file we are creating a new Typer app instance for the version command. This is not required in single-file applications, but in the case of multi-file applications it will allow us to include this command in the main application using `add_typer`.
4545

@@ -55,7 +55,7 @@ We'll see how to implement the user module in the next section.
5555

5656
///
5757

58-
{* docs_src/splitting_apps/main.py hl[8,9] *}
58+
{* docs_src/one_file_per_command/main.py hl[8,9] *}
5959

6060
In this module, we import the `version` and `users` modules and add them to the main app using `add_typer`.
6161

@@ -77,21 +77,21 @@ Let's now create the `users` module with the `add` and `delete` commands.
7777

7878
### Users Add Command (`users/add.py`)
7979

80-
{* docs_src/splitting_apps/users/add.py *}
80+
{* docs_src/one_file_per_command/users/add.py *}
8181

8282
Like the `version` module, we create a new Typer app instance for the `users/add` command. This allows us to include the `add` command in the users app.
8383

8484
### Users Delete Command (`users/delete.py`)
8585

86-
{* docs_src/splitting_apps/users/delete.py *}
86+
{* docs_src/one_file_per_command/users/delete.py *}
8787

8888
And once again, we create a new Typer app instance for the `users/delete` command. This allows us to include the `delete` command in the users app.
8989

9090
### Users' app (`users/__init__.py`)
9191

9292
Finally, we need to create an `__init__.py` file in the `users` directory to define the `users` app.
9393

94-
{* docs_src/splitting_apps/users/__init__.py *}
94+
{* docs_src/one_file_per_command/users/__init__.py *}
9595

9696
Similarly to the `version` module, we create a new `Typer` app instance for the `users` module. This allows us to include the `add` and `delete` commands in the users app.
9797

File renamed without changes.
File renamed without changes.
File renamed without changes.

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ nav:
134134
- tutorial/using-click.md
135135
- tutorial/package.md
136136
- tutorial/exceptions.md
137-
- tutorial/splitting-apps.md
137+
- tutorial/one-file-per-command.md
138138
- tutorial/typer-command.md
139139
- Resources:
140140
- resources/index.md

tests/test_tutorial/test_splitting_apps/__init__.py renamed to tests/test_tutorial/test_one_file_per_command/__init__.py

File renamed without changes.

tests/test_tutorial/test_splitting_apps/test_tutorial.py renamed to tests/test_tutorial/test_one_file_per_command/test_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typer.testing import CliRunner
22

3-
from docs_src.splitting_apps import main as mod
3+
from docs_src.one_file_per_command import main as mod
44

55
runner = CliRunner()
66

0 commit comments

Comments
 (0)