mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-20 04:48:53 +00:00
Added parameter checking for Directory.GetDirectories and Directory.GetFiles plugs. Lots of changes to FrodeTest.
42 lines
1 KiB
C#
42 lines
1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Cosmos.Sys;
|
|
using Cosmos.FileSystem;
|
|
using System.IO;
|
|
using FrodeTest.Shell;
|
|
|
|
namespace FrodeTest.Application
|
|
{
|
|
class dir : IConsoleApplication
|
|
{
|
|
#region IConsoleApplication Members
|
|
|
|
public int Execute(string[] args)
|
|
{
|
|
//Get current directory
|
|
string xCurrentDirectory = EnvironmentVariables.GetCurrent().CurrentDirectory;
|
|
|
|
foreach (string xDirectory in Directory.GetDirectories(xCurrentDirectory))
|
|
Console.WriteLine("<DIR> " + xDirectory);
|
|
|
|
foreach (string xFile in Directory.GetFiles(xCurrentDirectory))
|
|
Console.WriteLine(" " + xFile);
|
|
|
|
return 0;
|
|
}
|
|
|
|
public string CommandName
|
|
{
|
|
get { return "dir"; }
|
|
}
|
|
|
|
public string Description
|
|
{
|
|
get { return "Show content of current directory"; }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|