AZProductions / Kookaburra

Cross-Platform, Object-Oriented Programming language. With Kookaburra you can choose between the powerful CLI, or start coding with its' intuitive syntax.
https://azsoftware.org/Kookaburra
Other
11 stars 0 forks source link

`plugs.txt` #138

Closed AZProductions closed 2 years ago

AZProductions commented 2 years ago

Example:

wt=wt.exe
gh=gh.exe
git=/path/to/git.exe
AZProductions commented 2 years ago

Fixed with an autosearcher.

Demo:

string input = "git -h"
if (input.Length > 1) //Filters when the string is longer than 1 character. 
{
  try
  {
      Process process = new Process();
      process.StartInfo.FileName = input.Split(" ")[0];
      process.StartInfo.Arguments = input.Replace(input.Split(" ")[0], "");
      process.StartInfo.UseShellExecute = false;
      process.StartInfo.RedirectStandardOutput = true;
      process.Start();

      Console.WriteLine(process.StandardOutput.ReadToEnd());

      process.WaitForExit(); //Prevents the system to continue when the process is still not finished.
  }
  catch
  {
      Console.WriteLine("");
      Console.WriteLine("Command '{0}' not found.", input);
      Console.WriteLine("");
  }
}
else 
{
  Console.WriteLine("");
  Console.WriteLine("Command '{0}' not found.", input);
  Console.WriteLine("");
}