Improved argument parsing
This commit is contained in:
27
src/cpl_core/configuration/variable_argument.py
Normal file
27
src/cpl_core/configuration/variable_argument.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from cpl_core.configuration.argument_abc import ArgumentABC
|
||||
|
||||
|
||||
class VariableArgument(ArgumentABC):
|
||||
|
||||
def __init__(self,
|
||||
token: str,
|
||||
name: str,
|
||||
aliases: list[str],
|
||||
value_token: str,
|
||||
console_arguments: list['ArgumentABC'] = None
|
||||
):
|
||||
self._value_token = value_token
|
||||
self._value: str = ''
|
||||
|
||||
ArgumentABC.__init__(self, token, name, aliases, console_arguments)
|
||||
|
||||
@property
|
||||
def value_token(self) -> str:
|
||||
return self._value_token
|
||||
|
||||
@property
|
||||
def value(self) -> str:
|
||||
return self._value
|
||||
|
||||
def set_value(self, value: str):
|
||||
self._value = value
|
||||
Reference in New Issue
Block a user