added aliases for multiple commands

This commit is contained in:
Brazly
2026-01-16 03:32:02 +00:00
parent 6ff1ab2670
commit 4652c706b9

View File

@@ -62,7 +62,7 @@ func EnterCommand() -> void:
var parts = userInput.split(" ") var parts = userInput.split(" ")
match parts[0]: match parts[0]:
"ls": "ls", "list":
var currentDirData var currentDirData
if parts.size() > 1: if parts.size() > 1:
currentDirData = GetDirAtPath(directory + parts[1]) currentDirData = GetDirAtPath(directory + parts[1])
@@ -75,7 +75,7 @@ func EnterCommand() -> void:
CreateHistoryEntry(list) CreateHistoryEntry(list)
else: else:
CreateHistoryEntry("error: Directory not found") CreateHistoryEntry("error: Directory not found")
"cd": "cd", "changedirectory":
if parts.size() > 1: if parts.size() > 1:
var targetPath = parts[1] var targetPath = parts[1]
var newDir = ResolvePath(directory, targetPath) var newDir = ResolvePath(directory, targetPath)
@@ -85,12 +85,12 @@ func EnterCommand() -> void:
CreateHistoryEntry("cd: no such directory: " + targetPath) CreateHistoryEntry("cd: no such directory: " + targetPath)
else: else:
directory = "~/" directory = "~/"
"cat": "cat", "view":
if parts.size() > 1: if parts.size() > 1:
RetrieveData(parts[1]) RetrieveData(parts[1])
else: else:
CreateHistoryEntry("usage: cat [filename]") CreateHistoryEntry("usage: cat [filename]")
"clear": "clear", "cls":
for child in historyContainer.get_children(): for child in historyContainer.get_children():
if child != terminalLine: if child != terminalLine:
child.queue_free() child.queue_free()