Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Paradox.ConsoleProgram Class Reference

Reusable, reflection based helper for parsing commandline options. Greetings to Shawn Hargreaves, original code http://blogs.msdn.com/b/shawnhar/archive/2012/04/20/a-reusable-reflection-based-command-line-parser.aspx This is a modified version of command line parser that adds: More...

Inheritance diagram for SiliconStudio.Paradox.ConsoleProgram:
SiliconStudio.TextureConverter.Program

Classes

class  OptionAttribute
 

Public Member Functions

virtual string GetUsageFooter ()
 
void ShowError (string message, params object[] args)
 

Static Public Member Functions

static void PrintHeader ()
 
static bool ParseCommandLine (object options, string[] args, int padOptions=16)
 
static void ErrorColor ()
 
static void Color (ConsoleColor color)
 
static void ResetColor ()
 

Protected Member Functions

 ConsoleProgram (int padOptions=16)
 
bool ParseCommandLine (string[] args)
 

Detailed Description

Reusable, reflection based helper for parsing commandline options. Greetings to Shawn Hargreaves, original code http://blogs.msdn.com/b/shawnhar/archive/2012/04/20/a-reusable-reflection-based-command-line-parser.aspx This is a modified version of command line parser that adds:

  • .NET 2.0 compatible
  • Allow inheritance to simplify declaration
  • Print exe banner, using AssemblyTitle and AssemblyCopyright.
  • Better padding of options, add descriptor and value text overrides.
  • Add support for - and / starting options.
  • Remove usage of ":" to separate option from parsed option
  • Add "<options>" to the Usage when options are defined
  • Add Console Color handling

This single file is intended to be directly included in the project that needs to handle command line without requiring any SharpDX assembly dependencies.

Definition at line 51 of file ConsoleProgram.cs.

Constructor & Destructor Documentation

SiliconStudio.Paradox.ConsoleProgram.ConsoleProgram ( int  padOptions = 16)
protected

Definition at line 74 of file ConsoleProgram.cs.

Member Function Documentation

static void SiliconStudio.Paradox.ConsoleProgram.Color ( ConsoleColor  color)
static

Definition at line 383 of file ConsoleProgram.cs.

static void SiliconStudio.Paradox.ConsoleProgram.ErrorColor ( )
static

Definition at line 378 of file ConsoleProgram.cs.

virtual string SiliconStudio.Paradox.ConsoleProgram.GetUsageFooter ( )
virtual

Reimplemented in SiliconStudio.TextureConverter.Program.

Definition at line 288 of file ConsoleProgram.cs.

static bool SiliconStudio.Paradox.ConsoleProgram.ParseCommandLine ( object  options,
string[]  args,
int  padOptions = 16 
)
static

Definition at line 130 of file ConsoleProgram.cs.

bool SiliconStudio.Paradox.ConsoleProgram.ParseCommandLine ( string[]  args)
protected

Definition at line 138 of file ConsoleProgram.cs.

static void SiliconStudio.Paradox.ConsoleProgram.PrintHeader ( )
static

Definition at line 123 of file ConsoleProgram.cs.

static void SiliconStudio.Paradox.ConsoleProgram.ResetColor ( )
static

Definition at line 388 of file ConsoleProgram.cs.

void SiliconStudio.Paradox.ConsoleProgram.ShowError ( string  message,
params object[]  args 
)

Definition at line 293 of file ConsoleProgram.cs.


The documentation for this class was generated from the following file: