mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
Nano
This commit is contained in:
22
Shell.cs
22
Shell.cs
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user