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