From 6ab91b9dd6a0e36b501fb95d893b364e83ce081f Mon Sep 17 00:00:00 2001 From: NoahOnFyre Date: Sun, 21 Jan 2024 03:46:03 +0100 Subject: [PATCH] refactor: cleanup functions. --- main.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/main.go b/main.go index 8f72317..4f9635a 100644 --- a/main.go +++ b/main.go @@ -70,7 +70,9 @@ func main() { input := Input(color.Gray + "┌─[" + color.Blue + username + color.Gray + "@" + color.Reset + device + color.Gray + "]─(" + color.Reset + "\U000F024B" + " " + currentDir + color.Gray + ")\n" + color.Gray + "└─> " + color.Reset) if input != "" { Print() - command, args := ParseCommand(input) + split := strings.Split(input, " ") + command := split[0] + args := utils.RemoveElement(split, 0) RunCommand(command, args) } if semver.Compare(version, newestRelease.GetTagName()) == -1 { @@ -83,13 +85,6 @@ func main() { } } -func ParseCommand(input string) (string, []string) { - split := strings.Split(input, " ") - command := split[0] - args := utils.RemoveElement(split, 0) - return command, args -} - func RunCommand(command string, args []string) { commandFound := false for _, cmd := range commands {