1
+ #region License
2
+ // IFluentCommandLineBuilder.cs
3
+ // Copyright (c) 2013, Simon Williams
4
+ // All rights reserved.
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without modification, are permitted provide
7
+ // d that the following conditions are met:
8
+ //
9
+ // Redistributions of source code must retain the above copyright notice, this list of conditions and the
10
+ // following disclaimer.
11
+ //
12
+ // Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
13
+ // the following disclaimer in the documentation and/or other materials provided with the distribution.
14
+ //
15
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
16
+ // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
17
+ // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
18
+ // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
19
+ // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20
+ // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21
+ // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22
+ // POSSIBILITY OF SUCH DAMAGE.
23
+ #endregion
24
+
25
+ using System ;
26
+ using System . Linq . Expressions ;
27
+
28
+ namespace Fclp
29
+ {
30
+ /// <summary>
31
+ /// Parser that constructs and populates the specified type of object from command line arguments.
32
+ /// </summary>
33
+ public interface IFluentCommandLineBuilder < TBuildType > where TBuildType : new ( )
34
+ {
35
+ /// <summary>
36
+ /// Gets the constructed object.
37
+ /// </summary>
38
+ TBuildType Object { get ; }
39
+
40
+ /// <summary>
41
+ /// Sets up an Option for a write-able property on the type being built.
42
+ /// </summary>
43
+ ICommandLineOptionBuilderFluent < TProperty > Setup < TProperty > ( Expression < Func < TBuildType , TProperty > > propertyPicker ) ;
44
+
45
+ /// <summary>
46
+ /// Parses the specified <see><cref>T:System.String[]</cref></see> using the setup Options.
47
+ /// </summary>
48
+ /// <param name="args">The <see><cref>T:System.String[]</cref></see> to parse.</param>
49
+ /// <returns>An <see cref="ICommandLineParserResult"/> representing the results of the parse operation.</returns>
50
+ ICommandLineParserResult Parse ( string [ ] args ) ;
51
+
52
+ /// <summary>
53
+ /// Setup the help args.
54
+ /// </summary>
55
+ /// <param name="helpArgs">The help arguments to register.</param>
56
+ IHelpCommandLineOptionFluent SetupHelp ( params string [ ] helpArgs ) ;
57
+
58
+ /// <summary>
59
+ /// Gets or sets whether values that differ by case are considered different.
60
+ /// </summary>
61
+ bool IsCaseSensitive { get ; set ; }
62
+ }
63
+ }
0 commit comments