You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorial/one-file-per-command.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Multi-File Applications
1
+
# One File Per Command
2
2
3
3
When your CLI application grows, you can split it into multiple files and modules. This pattern helps maintain a clean and organized code structure.
4
4
@@ -39,7 +39,7 @@ Let's start implementing our CLI! We'll create the `version` module, the `main`
39
39
40
40
Let's start by creating the `version` module. This module will contain the `version` command.
41
41
42
-
{* docs_src/splitting_apps/version.py *}
42
+
{* docs_src/one_file_per_command/version.py *}
43
43
44
44
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`.
45
45
@@ -55,7 +55,7 @@ We'll see how to implement the user module in the next section.
In this module, we import the `version` and `users` modules and add them to the main app using `add_typer`.
61
61
@@ -77,21 +77,21 @@ Let's now create the `users` module with the `add` and `delete` commands.
77
77
78
78
### Users Add Command (`users/add.py`)
79
79
80
-
{* docs_src/splitting_apps/users/add.py *}
80
+
{* docs_src/one_file_per_command/users/add.py *}
81
81
82
82
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.
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.
0 commit comments