getopt.net
A port of getopt in pure C#.
Loading...
Searching...
No Matches
HelpTextConfig.cs
Go to the documentation of this file.
1using System;
2
3namespace getopt.net {
4
8 public sealed class HelpTextConfig {
9
13 public bool ShowSupportedConventions { get; set; } = false;
14
18 public int MaxWidth { get; set; } = 100;
19
23 public OptionConvention OptionConvention { get; set; } = OptionConvention.GnuPosix;
24
28 public string? ApplicationName { get; set; }
29
33 public string? ApplicationVersion { get; set; }
34
38 public string? FooterText { get; set; }
39
43 public DateTime? CopyrightDate { get; set; }
44
48 public string? CopyrightHolder { get; set; }
49
53 public static HelpTextConfig Default => GnuConfig();
54
58 public static HelpTextConfig GnuConfig() => new HelpTextConfig {
59 MaxWidth = 160,
61 ApplicationName = null,
62 ApplicationVersion = null,
63 FooterText = null
64 };
65
70 MaxWidth = 160,
72 ApplicationName = null,
73 ApplicationVersion = null,
74 FooterText = null
75 };
76
81 MaxWidth = 160,
83 ApplicationName = null,
84 ApplicationVersion = null,
85 FooterText = null
86 };
87
88 }
89
93 [Flags]
94 public enum OptionConvention {
95
100
104 Windows,
105
110
111 }
112
113}
A class that contains configuration options for the help text generator.
int MaxWidth
The maximum width of the help text.
string? ApplicationName
The name of the application.
string? ApplicationVersion
The version of the application.
static HelpTextConfig WindowsConfig()
Gets a configuration for the Windows convention.
string? FooterText
A footer text to be displayed under the help text.
bool ShowSupportedConventions
Whether to show the supported conventions in the help text.
static HelpTextConfig Default
Gets a default configuration.
DateTime? CopyrightDate
The date of the copyright.
string? CopyrightHolder
The holder of the copyright.
static HelpTextConfig GnuConfig()
Gets a configuration for the GNU/POSIX convention.
static HelpTextConfig PowershellConfig()
Gets a configuration for the Powershell convention.
OptionConvention
An enumeration of option conventions.
@ GnuPosix
The GNU/POSIX convention.
@ Powershell
The Powershell convention.
@ Windows
The Windows convention.