From bce8e43ff4dd46144398b0f41551d2d301be5799 Mon Sep 17 00:00:00 2001
From: moitoius_cp <7bd20ad30720b36bd251fb928c419f8754d57bfcCkJyHhZD>
Date: Wed, 9 Jan 2008 09:01:50 +0000
Subject: [PATCH] Added the version command. Lists developers and whatnot.
---
.../{BaseCommand.cs => CommandBase.cs} | 0
.../Commands/VersionCommand.cs | 68 +++++++++++++++++++
.../Cosmos.Shell.Console.csproj | 3 +-
source/Cosmos/Cosmos.Shell.Console/Program.cs | 2 +-
.../Cosmos/Cosmos.Shell.Console/Prompter.cs | 1 +
5 files changed, 72 insertions(+), 2 deletions(-)
rename source/Cosmos/Cosmos.Shell.Console/Commands/{BaseCommand.cs => CommandBase.cs} (100%)
create mode 100644 source/Cosmos/Cosmos.Shell.Console/Commands/VersionCommand.cs
diff --git a/source/Cosmos/Cosmos.Shell.Console/Commands/BaseCommand.cs b/source/Cosmos/Cosmos.Shell.Console/Commands/CommandBase.cs
similarity index 100%
rename from source/Cosmos/Cosmos.Shell.Console/Commands/BaseCommand.cs
rename to source/Cosmos/Cosmos.Shell.Console/Commands/CommandBase.cs
diff --git a/source/Cosmos/Cosmos.Shell.Console/Commands/VersionCommand.cs b/source/Cosmos/Cosmos.Shell.Console/Commands/VersionCommand.cs
new file mode 100644
index 000000000..83552e48d
--- /dev/null
+++ b/source/Cosmos/Cosmos.Shell.Console/Commands/VersionCommand.cs
@@ -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.");
+ }
+ }
+}
diff --git a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
index 8c3b66f44..cf12d56b8 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
+++ b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
@@ -52,7 +52,8 @@
-
+
+
diff --git a/source/Cosmos/Cosmos.Shell.Console/Program.cs b/source/Cosmos/Cosmos.Shell.Console/Program.cs
index 31a47a287..d4bc27e0c 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Program.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Program.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...");
diff --git a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs b/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
index 92a1d266c..c6e0dff40 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
@@ -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());