mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
docs
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from argenta import Router, Command, Response
|
||||
from argenta.response import ResponseStatus
|
||||
|
||||
router = Router(title="Example")
|
||||
|
||||
@router.command(Command("greet", description="Greet the user"))
|
||||
def greet_handler(response: Response):
|
||||
# response автоматически передаётся в обработчик
|
||||
# response.status содержит статус валидации флагов
|
||||
# response.input_flags содержит все введённые флаги
|
||||
|
||||
if response.status == ResponseStatus.ALL_FLAGS_VALID:
|
||||
print("Hello! All flags are valid.")
|
||||
else:
|
||||
print("Warning: Some flags have issues.")
|
||||
|
||||
Reference in New Issue
Block a user