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,17 @@
|
||||
from argenta.command import Flags, Flag
|
||||
from argenta import Command
|
||||
import re
|
||||
|
||||
|
||||
# Создание коллекции с флагами
|
||||
flags = Flags([
|
||||
Flag("host", possible_values=re.compile(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$")),
|
||||
Flag("port", possible_values=re.compile(r"^\d{1,5}$"))
|
||||
])
|
||||
|
||||
# Использование в команде
|
||||
cmd = Command(
|
||||
"start",
|
||||
description="Start the server",
|
||||
flags=flags
|
||||
)
|
||||
Reference in New Issue
Block a user