mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
work on
This commit is contained in:
@@ -4,7 +4,10 @@ import re
|
||||
|
||||
|
||||
@dataclass
|
||||
class PredeterminedFlags:
|
||||
class PredefinedFlags:
|
||||
"""
|
||||
Public. A dataclass with predefined flags and most frequently used flags for quick use
|
||||
"""
|
||||
HELP = Flag(name='help', possible_values=False)
|
||||
SHORT_HELP = Flag(name='h', prefix='-', possible_values=False)
|
||||
|
||||
|
||||
@@ -2,13 +2,23 @@ from typing import Literal, Pattern
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class BaseFlag:
|
||||
class BaseFlag(ABC):
|
||||
def __init__(self, name: str,
|
||||
prefix: Literal['-', '--', '---'] = '--'):
|
||||
"""
|
||||
Private. Base class for flags
|
||||
:param name: the name of the flag
|
||||
:param prefix: the prefix of the flag
|
||||
:return: None
|
||||
"""
|
||||
self._name = name
|
||||
self._prefix = prefix
|
||||
|
||||
def get_string_entity(self):
|
||||
"""
|
||||
Private. Returns a string representation of the flag
|
||||
:return: None
|
||||
"""
|
||||
string_entity: str = self._prefix + self._name
|
||||
return string_entity
|
||||
|
||||
|
||||
Reference in New Issue
Block a user