using System;
namespace AsterNET.FastAGI.Command
{
///
/// Executes an application with the given options.
/// Returns whatever the application returns, or -2 if the application was not found.
///
public class ExecCommand : AGICommand
{
/// The name of the application to execute.
private string application;
/// The options to pass to the application.
private string options;
///
/// Get/Set the name of the application to execute.
///
public string Application
{
get { return application; }
set { this.application = value; }
}
///
/// Get/Set the options to pass to the application.
///
public string Options
{
get { return options; }
set { this.options = value; }
}
///
/// Creates a new ExecCommand.
///
/// the name of the application to execute.
public ExecCommand(string application)
{
this.application = application;
}
///
/// Creates a new ExecCommand.
///
/// the name of the application to execute.
/// the options to pass to the application.
public ExecCommand(string application, string options)
{
this.application = application;
this.options = options;
}
public override string BuildCommand()
{
return "EXEC " + EscapeAndQuote(application) + " " + EscapeAndQuote(options);
}
}
}