0

Getting this error: Invalid option file options on trying to invoke Astyle via C#

  System.Diagnostics.Process pProcess = new System.Diagnostics.Process();
    pProcess.StartInfo.FileName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\Astyle.exe";

    //strCommandParameters are parameters to pass to program
    //pProcess.StartInfo.Arguments = "--style=ansi --recursive  "+System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)+"/*.cpp";

    pProcess.StartInfo.Arguments = " options=none test.cpp";
    //pProcess.StartInfo.Arguments = " -h";
    pProcess.StartInfo.UseShellExecute = false;

    //Set output of program to be written to process output stream
    pProcess.StartInfo.RedirectStandardOutput = true;
    pProcess.StartInfo.RedirectStandardError = true;
    //Optional
    pProcess.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

    //Start the process
    pProcess.Start();

    //Get program output
    string strOutput = pProcess.StandardOutput.ReadToEnd();
    string strError = pProcess.StandardError.ReadToEnd();
    //Wait for process to finish
    pProcess.WaitForExit();
4b0
  • 21,981
  • 30
  • 95
  • 142
kingpin
  • 83
  • 3
  • 12

1 Answers1

1

If you take a look at this link the correct syntax seems to be

--options=none
Marco
  • 56,740
  • 14
  • 129
  • 152
  • +1 for digging through documentation even without a link provided. – alexn Apr 10 '12 at 06:33
  • @kingpin: remember you should [accept an answer](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) if it solved (or helped to solve) your problem – Marco Apr 11 '12 at 12:38