Added help for all commands & general better output

Changes:
- added help fo all/specific commands
- unified the output of check/update
- beautified the output of check/update
- a little code cleanup
This commit is contained in:
Neocky
2021-03-21 14:30:27 +01:00
parent 01465eb769
commit e1efcc4fc7
5 changed files with 113 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
import sys
from utils.consoleoutput import oColors
from utils.utilities import getHelp
from utils.utilities import getHelp, getCommandHelp
from handlers.handle_config import checkConfig
from plugin.plugin_downloader import searchPackage, getSpecificPackage
from plugin.plugin_updatechecker import updateInstalledPackage, checkInstalledPackage
@@ -68,7 +68,11 @@ def handleInput(inputCommand, inputSelectedObject, inputParams):
if inputCommand == 'exit':
sys.exit()
if inputCommand == 'help':
getHelp()
print(inputParams)
if inputSelectedObject == 'command' or inputSelectedObject == 'commands':
getCommandHelp(inputParams)
else:
getHelp()
break
if inputCommand == 'remove':
removePlugin(inputSelectedObject)
@@ -77,7 +81,7 @@ def handleInput(inputCommand, inputSelectedObject, inputParams):
papermc_downloader(inputSelectedObject, inputParams)
break
else:
print(oColors.brightRed + "Command not found. Please try again." + oColors.standardWhite)
print(oColors.brightRed + "Error: Command not found. Please try again. :(" + oColors.standardWhite)
getInput()
getInput()
@@ -88,7 +92,8 @@ def getInput():
inputCommand, inputSelectedObject, *inputParams = input("pluGET >> ").split()
break
except ValueError:
print(oColors.brightRed + "Wrong input! Use: > *command* *selectedObject* *optionalParams*" + oColors.standardWhite)
print(oColors.brightRed + "Wrong input! Use: > 'command' 'selectedObject' [optionalParams]" + oColors.standardWhite)
print(oColors.brightRed + "Use: '" + oColors.standardWhite +"help command" + oColors.brightRed +"' to get all available commands" + oColors.standardWhite)
inputParams = inputParams[0] if inputParams else None
handleInput(inputCommand, inputSelectedObject, inputParams)