Added new help command

- added new help command
- fixed some formating issues
This commit is contained in:
Jan-Luca Bogdan | BEL NET GmbH
2022-07-04 15:55:08 +02:00
parent 6b926c9564
commit 0e09daae53
2 changed files with 73 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ Handles the input through the pluGET command line
"""
from src.utils.console_output import rich_print_error
from src.utils.utilities import get_command_help
from src.plugin.plugin_remover import delete_plugin
from src.plugin.plugin_downloader import get_specific_plugin_spiget, search_specific_plugin_spiget
from src.plugin.plugin_updatechecker import check_installed_plugins, update_installed_plugins
@@ -22,6 +23,7 @@ from src.serverjar.serverjar_purpur import serverjar_purpur_update
# exit
# remove
# search
# help
def handle_input(
@@ -86,11 +88,13 @@ def handle_input(
search_specific_plugin_spiget(input_selected_object)
case "remove":
delete_plugin(input_selected_object)
case "help":
get_command_help(input_selected_object)
case "exit":
return
case _:
rich_print_error("Error: Command not found. Please try again. :(")
rich_print_error("Use: 'help command' to get all available commands")
rich_print_error("Use [bright_blue]'help all' [bright_red]to get a list of all available commands.")
# return to break out of while loop if pluGET was started with arguments from console
if arguments_from_console:
@@ -117,7 +121,7 @@ def get_input() -> str:
continue
else:
rich_print_error("Wrong input! Use: > 'command' 'selectedObject' [optionalParams]")
rich_print_error("Use: 'help command' to get all available commands")
rich_print_error("Use: [bright_blue]'help all' [bright_red]to get a list of all available commands.")
except KeyboardInterrupt:
return
input_parameter = input_parameter[0] if input_parameter else None