mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
docs
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from argenta import Router, Command, Response
|
||||
from argenta.command.flag import InputFlag, ValidationStatus, InputFlags
|
||||
|
||||
router = Router(title="Add Flag Example")
|
||||
|
||||
@router.command(Command("test", description="Test command"))
|
||||
def test_handler(response: Response):
|
||||
# Создаём новую коллекцию InputFlags
|
||||
new_flags = InputFlags()
|
||||
|
||||
# Добавляем один флаг
|
||||
test_flag = InputFlag(
|
||||
name="test",
|
||||
prefix="--",
|
||||
input_value="value",
|
||||
status=ValidationStatus.VALID
|
||||
)
|
||||
new_flags.add_flag(test_flag)
|
||||
|
||||
print(f"Flags count: {len(new_flags.flags)}")
|
||||
print(f"First flag: {new_flags.flags[0].name}")
|
||||
|
||||
Reference in New Issue
Block a user