Start() in IProgram has been renamed to Run()

- Run() loop in the shell is now wrapped in a try-catch statement.
- Added Github CI
- Removed OSConsts and TermConsts
- Programs can now access the programs dictionary directly from the shell
This commit is contained in:
Tony Bark 2021-03-31 00:10:38 -04:00
parent d1ccfad2ae
commit 4f0863f429
16 changed files with 149 additions and 93 deletions

View file

@ -0,0 +1,15 @@
// I license this project under the GPL 3.0 license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Interface
{
public interface IProgram
{
/// <summary>
/// The program's main entry point. Boolean behaves as an exit point.
/// True and False are the equivalent to C's 0 and 1, i.e. "Success" and "Failure," respectfully.
/// </summary>
/// <param name="shell">Allows the program to interact with the shell.</param>
/// <returns>Exit back to shell.</returns>
bool Run(IShell shell);
}
}

View file

@ -1,9 +1,14 @@
// I license this project under the GPL 3.0 license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Interface.Shell
using System.Collections.Generic;
namespace Tomas.Interface
{
public interface IShell
{
string ReadLine { get; }
Dictionary<string, IProgram> Programs { get; }
}
}

View file

@ -1,9 +0,0 @@
// I license this project under the GPL 3.0 license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Interface.Shell
{
public interface IProgram
{
bool Start();
}
}