mirror of
https://github.com/Leonmmcoset/CMLeonOS.git
synced 2026-03-03 15:30:27 +00:00
拆分代码4
This commit is contained in:
19
shell/Commands/FileSystem/CatCommand.cs
Normal file
19
shell/Commands/FileSystem/CatCommand.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace CMLeonOS.Commands.FileSystem
|
||||
{
|
||||
public static class CatCommand
|
||||
{
|
||||
public static void ProcessCat(CMLeonOS.FileSystem fileSystem, string args, Action<string> showError)
|
||||
{
|
||||
if (string.IsNullOrEmpty(args))
|
||||
{
|
||||
showError("Please specify a file name");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine(fileSystem.ReadFile(args));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user