This commit is contained in:
2025-11-02 01:04:31 +03:00
parent 64c984a704
commit 9c58c10152
70 changed files with 341 additions and 391 deletions
+10 -11
View File
@@ -3,17 +3,17 @@ from argenta.command import Flag, Flags
router = Router(title="Bool Check Example")
@router.command(Command(
"action",
description="Action with optional flags",
flags=Flags([
Flag("option1"),
Flag("option2")
])
))
@router.command(
Command(
"action",
description="Action with optional flags",
flags=Flags([Flag("option1"), Flag("option2")]),
)
)
def action_handler(response: Response):
input_flags = response.input_flags
# Проверяем наличие флагов
if input_flags:
print("Flags were provided:")
@@ -21,8 +21,7 @@ def action_handler(response: Response):
print(f" - {flag.name}: {flag.input_value}")
else:
print("No flags provided, using defaults")
# Альтернативный способ проверки
has_flags = bool(input_flags)
print(f"\nHas flags: {has_flags}")