using System.Diagnostics;

namespace MarketData.Extensions
{
  public static class ProcessExtensions
  {
    public static List<String> GetUnixCommandArguments(this Process process)
    {
      List<String> commandArguments = new List<String>();
      String commandFile = $"/proc/{ process.Id }/cmdline";
      if(!File.Exists(commandFile))return commandArguments;
      String commandLine = File.ReadAllText(commandFile);
      return commandLine.Split('\0').ToList();
    }    
  }
}