Update documentation and code snippets

This commit is contained in:
2025-12-02 11:22:31 +03:00
parent 2ff47398ba
commit 7c20bf296b
23 changed files with 63 additions and 62 deletions
+3 -3
View File
@@ -7,15 +7,15 @@ router = Router()
@router.command("get_args")
def get_args(response: Response, argspace: FromDishka[ArgSpace]):
# Получение всех булевых флагов
# Get all boolean flags
boolean_flags = argspace.get_by_type(BooleanArgument)
print(f"Active flags: {[arg.name for arg in boolean_flags if arg.value]}")
# Получение всех аргументов со значениями
# Get all value arguments
value_args = argspace.get_by_type(ValueArgument)
for arg in value_args:
print(f"{arg.name} = {arg.value}")
# Подсчет количества аргументов каждого типа
# Count arguments of each type
print(f"Boolean arguments: {len(argspace.get_by_type(BooleanArgument))}")
print(f"Value arguments: {len(argspace.get_by_type(ValueArgument))}")