From: Jarl Gullberg Date: Sat, 15 Jul 2017 13:40:03 +0000 (+0200) Subject: Implemented options class. X-Git-Tag: v3.0.0~82^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e39a4cb48f0d1318966c8061154d117df3f8f5af;p=platform%2Fcore%2Fcsapi%2Fopentk.git Implemented options class. --- diff --git a/src/Generator.Converter/Options.cs b/src/Generator.Converter/Options.cs index 09890c5..eaf85a0 100644 --- a/src/Generator.Converter/Options.cs +++ b/src/Generator.Converter/Options.cs @@ -1,11 +1,43 @@ -using CommandLine; +using System.Collections.Generic; +using CommandLine; +using CommandLine.Text; namespace OpenTK.Convert { public class Options { + [Option('p', "prefix", + HelpText = "The prefix to remove from parsed functions and constants.", + Required = true, + Default = "gl")] public string Prefix { get; set; } - public string OutputPath { get; set; } - public string InputFiles { get; set; } + + [Option('o', "output-file", + HelpText = "The path to the output file. Defaults to stdout if no path is provided.")] + public string OutputFile { get; set; } + + [Option('i', "input-files", + HelpText = "A list of the Khronos XML files to parse into OpenTK XML. Remote resources in the form of URLs are supported.", + Required = true)] + public IEnumerable InputFiles { get; set; } + + [Usage(ApplicationAlias = "Convert.exe")] + public static IEnumerable Examples + { + get + { + yield return new Example + ( + "Converting local files", + new Options { Prefix = "gl", OutputFile = "signatures.xml", InputFiles = new []{ "gl.xml" } } + ); + + yield return new Example + ( + "Converting latest remote specification", + new Options { Prefix = "gl", OutputFile = "signatures.xml", InputFiles = new []{ "https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml" } } + ); + } + } } } \ No newline at end of file