using System;
using System.Runtime.InteropServices;
using CommandLine;
using CommandLine.Text;


namespace Trigger
{
	/// <summary>
	/// <para>Command line options</para>
	/// </summary>
	public class Options
	{
		/// <summary>
		/// <para>The name of the event that shall be triggered</para>
		/// <para>Every registered event handler has to compare this integer to the event it is waiting for</para>
		/// </summary>
		[Option('t', "trigger", Required = false, HelpText = "The command line event that shall be triggered.\nUse \"string\".GetHashCode() to check against the retreived event code.")]
		public string Trigger { get; set; }

		/// <summary>
		/// <para>Signal that this thread was started to gain administrator privileges</para>
		/// </summary>
		[Option('a', "admin", Required = false, DefaultValue = false, HelpText = "Don't use this")]
		public bool Admin { get; set; }

		/// <summary>
		/// <para>Prints some help text</para>
		/// </summary>
		/// <returns></returns>
		[HelpOption]
		public string GetUsage()
		{
			return HelpText.AutoBuild(this, current => HelpText.DefaultParsingErrorsHandler(this, current));
		}
	}
}