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
|
from command_parser.option import Option
|
||||||
|
|
||||||
|
|
||||||
class Flag(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)
|
super(Flag, self).__init__(name, single_char)
|
||||||
self.value = default
|
self.value = default
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
from command_parser import logger
|
from command_parser import logger
|
||||||
|
|
||||||
|
|
||||||
class Option:
|
class Option:
|
||||||
def __init__(self, name: str, single_char: str | None = None) -> None:
|
def __init__(
|
||||||
logger.debug(
|
self, name: str, single_char: str | None = None
|
||||||
_("creating new option with the name {name}")
|
) -> None:
|
||||||
)
|
logger.debug(_("creating new option with the name {name}"))
|
||||||
if single_char is None:
|
if single_char is None:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
_(
|
_(
|
||||||
|
@ -21,9 +22,7 @@ class Option:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
logger.debug(
|
logger.debug(
|
||||||
_(
|
_("single char {char} defined").format(char=single_char)
|
||||||
"single char {char} defined"
|
|
||||||
).format(char = single_char)
|
|
||||||
)
|
)
|
||||||
self.name = name
|
self.name = name
|
||||||
self.single_char = single_char
|
self.single_char = single_char
|
||||||
|
|
|
@ -3,6 +3,7 @@ from command_parser import logger
|
||||||
from command_parser.flag import Flag
|
from command_parser.flag import Flag
|
||||||
from command_parser.value import Value
|
from command_parser.value import Value
|
||||||
|
|
||||||
|
|
||||||
def parse(line: str, flags: list[Flag], values: list[Value]):
|
def parse(line: str, flags: list[Flag], values: list[Value]):
|
||||||
"""
|
"""
|
||||||
parse a command line parser
|
parse a command line parser
|
||||||
|
|
Loading…
Reference in a new issue