mirror of
https://github.com/tonytins/tomas.git
synced 2025-07-21 23:04:52 -04:00
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:
parent
d1ccfad2ae
commit
4f0863f429
16 changed files with 149 additions and 93 deletions
15
src/Tomas.Interface/IProgram.cs
Normal file
15
src/Tomas.Interface/IProgram.cs
Normal 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);
|
||||
}
|
||||
}
|
|
@ -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; }
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue