mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-11 10:41:33 +00:00
Added the version command. Lists developers and whatnot.
This commit is contained in:
parent
9507e22f8e
commit
bce8e43ff4
5 changed files with 72 additions and 2 deletions
|
|
@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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...");
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue