Skip to content
Snippets Groups Projects

add cli optparse format

Merged Evgeniy Yurchenko requested to merge add_cli into main
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -20,7 +20,7 @@ class CliCallback(Protocol):
pass
class CFAppCliServer:
class CFCliCommand:
def __init__(self, command: str, callback: CliCallback, help_text: str = ""):
"""
Use https://docs.python.org/3.10/library/optparse.html, for configuration cli command
@@ -30,7 +30,7 @@ class CFAppCliServer:
self.help_text = help_text
self.parser = OptionParser()
def confirm(self):
def register(self):
def callback_wrapper(argv: list[str], reply_id: ReplyId):
(options, args) = self.parser.parse_args(argv[1:])
self.callback(*args, reply_object=ReplyObject(reply_id), **options.__dict__)
Loading