mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
first beta - adding hints for similar commands, now - feature freezing
This commit is contained in:
+2
-8
@@ -11,13 +11,7 @@ from argenta.router import Router
|
||||
from argenta.orchestrator import Orchestrator
|
||||
|
||||
from argenta.command.models import InputCommand
|
||||
from argenta.app.utils import most_similar_command
|
||||
|
||||
|
||||
while True:
|
||||
cmd = input(">>> ")
|
||||
if cmd == "exit":
|
||||
break
|
||||
else:
|
||||
parse_cmd: InputCommand = InputCommand.parse(cmd)
|
||||
print(f'name: {parse_cmd.get_trigger()}\n'
|
||||
f'flags: {parse_cmd.get_input_flags().get_flags()}\n')
|
||||
print(most_similar_command('case', ['case', 'tester', 'poster', 'caser']))
|
||||
|
||||
@@ -2,8 +2,7 @@ from rich.console import Console
|
||||
|
||||
from argenta.command import Command
|
||||
from argenta.command.flag.defaults import PredefinedFlags
|
||||
from argenta.command.flag.models import Flag
|
||||
from argenta.command.flags.models import Flags
|
||||
from argenta.command.flags import Flags
|
||||
from argenta.response import Response
|
||||
from argenta.router import Router
|
||||
|
||||
@@ -13,8 +12,7 @@ work_router: Router = Router(title='Work points:')
|
||||
console = Console()
|
||||
|
||||
|
||||
@work_router.command(Command('get', 'Get Help', aliases=['help', 'Get_help'], flags=Flags(PredefinedFlags.PORT,
|
||||
PredefinedFlags.HOST)))
|
||||
@work_router.command(Command('get', 'Get Help', aliases=['help', 'Get_help'], flags=Flags(PredefinedFlags.PORT, PredefinedFlags.HOST)))
|
||||
def command_help(response: Response):
|
||||
print(response.status)
|
||||
print(response.undefined_flags.get_flags())
|
||||
|
||||
@@ -12,7 +12,7 @@ from argenta.orchestrator.argparser.arguments import BooleanArgument
|
||||
arg_parser = ArgParser(processed_args=[BooleanArgument('repeat')])
|
||||
app: App = App(dividing_line=DynamicDividingLine(),
|
||||
autocompleter=AutoCompleter('./mock/.hist'),
|
||||
repeat_command_groups=False)
|
||||
repeat_command_groups=False,)
|
||||
orchestrator: Orchestrator = Orchestrator(arg_parser)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user