-
-
Notifications
You must be signed in to change notification settings - Fork 675
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ 📝 Refactor docs' structure and add CLI option names
- Loading branch information
Showing
61 changed files
with
1,512 additions
and
844 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import typer | ||
|
||
app = typer.Typer() | ||
|
||
|
||
@app.command(help="Create a new user with USERNAME.") | ||
def create(username: str): | ||
""" | ||
Some internal utility function to create. | ||
""" | ||
typer.echo(f"Creating user: {username}") | ||
|
||
|
||
@app.command(help="Delete a user with USERNAME.") | ||
def delete(username: str): | ||
""" | ||
Some internal utility function to delete. | ||
""" | ||
typer.echo(f"Deleting user: {username}") | ||
|
||
|
||
if __name__ == "__main__": | ||
app() |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import typer | ||
|
||
|
||
def main(user_name: str = typer.Option(..., "--name")): | ||
typer.echo(f"Hello {user_name}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import typer | ||
|
||
|
||
def main(user_name: str = typer.Option(..., "--name", "-n")): | ||
typer.echo(f"Hello {user_name}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import typer | ||
|
||
|
||
def main(user_name: str = typer.Option(..., "-n")): | ||
typer.echo(f"Hello {user_name}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import typer | ||
|
||
|
||
def main(user_name: str = typer.Option(..., "--user-name", "-n")): | ||
typer.echo(f"Hello {user_name}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import typer | ||
|
||
|
||
def main( | ||
name: str = typer.Option(..., "--name", "-n"), | ||
formal: bool = typer.Option(False, "--formal", "-f"), | ||
): | ||
if formal: | ||
typer.echo(f"Good day Ms. {name}.") | ||
else: | ||
typer.echo(f"Hello {name}") | ||
|
||
|
||
if __name__ == "__main__": | ||
typer.run(main) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.