This commit is contained in:
2026-02-03 14:00:46 +08:00
parent 3c21a1ce3a
commit 26ed041397
3 changed files with 759 additions and 37 deletions

View File

@@ -295,6 +295,9 @@ namespace CMLeonOS
case "edit":
EditFile(args);
break;
case "nano":
NanoFile(args);
break;
case "ls":
fileSystem.ListFiles(args);
break;
@@ -742,6 +745,25 @@ namespace CMLeonOS
}
}
private void NanoFile(string fileName)
{
if (string.IsNullOrEmpty(fileName))
{
ShowError("Please specify a file name");
return;
}
try
{
var nano = new Nano(fileName, true, fileSystem, userSystem, this);
nano.Start();
}
catch (Exception ex)
{
ShowError($"Error starting nano: {ex.Message}");
}
}
private void HeadFile(string args)
{
if (string.IsNullOrEmpty(args))