refactor and optimize argspace

This commit is contained in:
2025-11-28 14:31:51 +03:00
parent 1eaf2b6333
commit be178b10c7
7 changed files with 68 additions and 31 deletions
+6 -3
View File
@@ -1,10 +1,13 @@
from argenta import App, Orchestrator
from argenta.orchestrator.argparser import ArgParser, BooleanArgument
from argenta.orchestrator.argparser import ArgParser, BooleanArgument, ValueArgument
arg_parser = ArgParser(processed_args=[BooleanArgument("config")])
arg_parser = ArgParser(processed_args=[BooleanArgument("dev"), ValueArgument('some', possible_values=['fuck', 'cruck'])])
orchestrator = Orchestrator(
arg_parser=arg_parser,
)
if __name__ == "__main__":
orchestrator.start_polling(App())
if arg_parser.parsed_argspace.get_by_name('dev'):
orchestrator.start_polling(App(initial_message='ArgentaDev'))
else:
orchestrator.start_polling(App())