Files
CMLeonOS/shell/Commands/Editor/EditCommand.cs

27 lines
679 B
C#
Raw Normal View History

2026-02-04 20:42:11 +08:00
using System;
namespace CMLeonOS.Commands.Editor
{
public static class EditCommand
{
public static void EditFile(string fileName, CMLeonOS.FileSystem fileSystem, Action<string> showError)
{
if (string.IsNullOrEmpty(fileName))
{
showError("Please specify a file name");
return;
}
try
{
2026-02-25 15:33:46 +08:00
var nano = new CMLeonOS.Nano(fileName, true, fileSystem);
nano.Start();
2026-02-04 20:42:11 +08:00
}
catch (Exception ex)
{
showError($"Error starting editor: {ex.Message}");
}
}
}
}