mirror of
https://gitlab.acidiclight.dev/sociallydistant/sociallydistant.git
synced 2025-01-22 17:41:49 -05:00
Implement the ls command
This commit is contained in:
parent
72f01b1342
commit
65459cd36c
1 changed files with 22 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
using Architecture;
|
||||
using UnityEngine;
|
||||
using Utility;
|
||||
|
||||
namespace UI.ScriptableCommands
|
||||
{
|
||||
|
@ -11,7 +12,27 @@ namespace UI.ScriptableCommands
|
|||
/// <inheritdoc />
|
||||
protected override void OnExecute()
|
||||
{
|
||||
Console.WriteLine("TBD");
|
||||
// TODO: Listing directories specified in arguments
|
||||
// TODO: Colorful output
|
||||
// TODO: Different output styles
|
||||
// error out if the current directory doesn't exist
|
||||
if (!FileSystem.DirectoryExists(CurrentWorkingDirectory))
|
||||
{
|
||||
Console.WriteLine($"ls: {CurrentWorkingDirectory}: Directory not found.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string directory in FileSystem.GetDirectories(CurrentWorkingDirectory))
|
||||
{
|
||||
string filename = PathUtility.GetFileName(directory);
|
||||
Console.WriteLine(filename);
|
||||
}
|
||||
|
||||
foreach (string directory in FileSystem.GetFiles(CurrentWorkingDirectory))
|
||||
{
|
||||
string filename = PathUtility.GetFileName(directory);
|
||||
Console.WriteLine(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue