mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
feat: impl docs (#4)
The entire public api is covered with documentation in two languages - Russian and English. the library now supports the latest three versions of python - 3.12, 3.13 and 3.14 minor design changes: now, when a Boolean flag is entered, its value is an empty string, not None. tests have been adapted to the supported versions of python, readmi has been redesigned in two languages, German is no longer available.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import re
|
||||
from argenta.command import Flag, PossibleValues
|
||||
|
||||
# Simple flag with any values
|
||||
verbose_flag = Flag(name="verbose")
|
||||
|
||||
# Flag with short prefix
|
||||
short_flag = Flag(name="v", prefix="-")
|
||||
|
||||
# Flag that does not take a value
|
||||
help_flag = Flag(name="help", possible_values=PossibleValues.NEITHER)
|
||||
|
||||
# Flag with list of possible values
|
||||
format_flag = Flag(name="format", possible_values=["json", "xml", "csv"])
|
||||
|
||||
# Flag with regexp for validation input value
|
||||
email_flag = Flag(
|
||||
name="email",
|
||||
possible_values=re.compile(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"),
|
||||
)
|
||||
Reference in New Issue
Block a user