added aliases for multiple commands
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user