Update formating
This commit is contained in:
parent
8fdb78b908
commit
94edd899d0
4 changed files with 20 additions and 14 deletions
|
@ -1,7 +1,13 @@
|
|||
from command_parser.option import Option
|
||||
|
||||
|
||||
class Flag(Option):
|
||||
def __init__(self, name: str, default: bool = False, single_char: str | None = None) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
name: str,
|
||||
default: bool = False,
|
||||
single_char: str | None = None,
|
||||
) -> None:
|
||||
super(Flag, self).__init__(name, single_char)
|
||||
self.value = default
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from command_parser import logger
|
||||
|
||||
|
||||
class Option:
|
||||
def __init__(self, name: str, single_char: str | None = None) -> None:
|
||||
logger.debug(
|
||||
_("creating new option with the name {name}")
|
||||
)
|
||||
def __init__(
|
||||
self, name: str, single_char: str | None = None
|
||||
) -> None:
|
||||
logger.debug(_("creating new option with the name {name}"))
|
||||
if single_char is None:
|
||||
logger.debug(
|
||||
_(
|
||||
|
@ -21,9 +22,7 @@ class Option:
|
|||
)
|
||||
)
|
||||
logger.debug(
|
||||
_(
|
||||
"single char {char} defined"
|
||||
).format(char = single_char)
|
||||
_("single char {char} defined").format(char=single_char)
|
||||
)
|
||||
self.name = name
|
||||
self.single_char = single_char
|
||||
|
|
|
@ -3,6 +3,7 @@ from command_parser import logger
|
|||
from command_parser.flag import Flag
|
||||
from command_parser.value import Value
|
||||
|
||||
|
||||
def parse(line: str, flags: list[Flag], values: list[Value]):
|
||||
"""
|
||||
parse a command line parser
|
||||
|
|
Loading…
Reference in a new issue