Added the version command. Lists developers and whatnot.

This commit is contained in:
moitoius_cp 2008-01-09 09:01:50 +00:00
parent 9507e22f8e
commit bce8e43ff4
5 changed files with 72 additions and 2 deletions

View file

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Shell.Console.Commands
{
public class VersionCommand : CommandBase
{
public override string Name
{
get { return "version"; }
}
public override string Summary
{
get { return "Displays version information about Cosmos."; }
}
public override void Execute(string param)
{
if (param == "" || param == "ver")
{
DisplayVersion();
}
else if (param == "dev")
{
DisplayDevelopers();
}
}
private void DisplayDevelopers()
{
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine("Cosmos Developers");
System.Console.WriteLine("~~~~~~~~~~~~~~~~~");
System.Console.ForegroundColor = ConsoleColor.White;
System.Console.WriteLine("Chad Z. Hower");
System.Console.WriteLine("Matthijs ter Woord");
System.Console.WriteLine("Jonathan Dickinson");
System.Console.WriteLine();
}
private void DisplayVersion()
{
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine("Cosmos Copyright 2008 The Cosmos Project");
System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.Console.ForegroundColor = ConsoleColor.White;
System.Console.Write("Version 0.0.0.1 - ");
System.Console.ForegroundColor = ConsoleColor.Green;
System.Console.WriteLine("Milestone 1");
System.Console.ForegroundColor = ConsoleColor.White;
System.Console.WriteLine();
}
public override void Help()
{
System.Console.WriteLine("version [ver|dev]");
System.Console.Write(" "); System.Console.WriteLine(Summary);
System.Console.WriteLine();
System.Console.WriteLine(" ver: Displays the version information.");
System.Console.WriteLine(" dev: Displays information about the developers.");
}
}
}

View file

@ -52,7 +52,8 @@
<Compile Include="Commands\HelpCommand.cs" />
<Compile Include="Commands\MatthijsCommand.cs" />
<Compile Include="Commands\TypeCommand.cs" />
<Compile Include="Commands\BaseCommand.cs" />
<Compile Include="Commands\CommandBase.cs" />
<Compile Include="Commands\VersionCommand.cs" />
<Compile Include="Program.cs" />
<Compile Include="Prompter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View file

@ -20,7 +20,7 @@ namespace Cosmos.Shell.Console {
System.Console.BackgroundColor = ConsoleColor.Black;
System.Console.ForegroundColor = ConsoleColor.Red;
System.Console.WriteLine("Cosmos Kernel. Copyright 2007-2008 The Cosmos Project.");
System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.Console.ForegroundColor = ConsoleColor.Green;
System.Console.WriteLine("Now Booting...");

View file

@ -30,6 +30,7 @@ namespace Cosmos.Shell.Console {
//_commands.Add(new Commands.ExitCommand(Stop)); // TODO: Fix this.
_commands.Add(new Commands.HelpCommand(_commands));
_commands.Add(new Commands.TypeCommand());
_commands.Add(new Commands.VersionCommand());
_commands.Add(new Commands.MatthijsCommand());