about summary refs log tree commit diff
path: root/pkgs/games/build-support/monogame-patcher/src/options.cs
blob: 32a8403e15f2339e677db3a54e3c19df2258bb13 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections.Generic;

using CommandLine;

class GenericOptions
{
    [Option('i', "infile", Required=true, HelpText="Input file to transform.")]
    public string inputFile { get; set; }
    [Option('o', "outfile", HelpText="File to write transformed data to.")]
    public string outputFile { get; set; }
}

[Verb("fix-filestreams", HelpText="Fix System.IO.FileStream constructors"
                                 +" to open files read-only.")]
class FixFileStreamsCmd : GenericOptions {
    [Value(0, Required=true, MetaName = "type", HelpText = "Types to patch.")]
    public IEnumerable<string> typesToPatch { get; set; }
};

[Verb("replace-call", HelpText="Replace calls to types.")]
class ReplaceCallCmd : GenericOptions {
    [Value(0, Required=true, HelpText="Method call to replace.")]
    public string replaceMethod { get; set; }

    [Value(1, Required=true, HelpText="The replacement method.")]
    public string replacementMethod { get; set; }

    [Value(2, Required=true, MetaName = "type", HelpText = "Types to patch.")]
    public IEnumerable<string> typesToPatch { get; set; }
};