mirror of
https://github.com/SabreTools/SabreTools.CommandLine.git
synced 2026-02-05 05:37:40 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
46d1fb7ca6 | ||
|
|
98617b9961 | ||
|
|
0573e4f180 | ||
|
|
9ce9d1461e |
@@ -6,6 +6,8 @@ This library contains logic to both parse commandlines using typed inputs as wel
|
||||
|
||||
All inputs allow for non-flag inputs in both `a=b` and `a b` formats. This allows for greater flexibility for cross-platform support. Flags for each input are fully defined by the implementer, so inputs of the form `-a`, `--a`, `/a`, and `a` are all accepted and can even be mixed. The only restriction is that flags should not end with the `=` character as it may interfere with default parsing.
|
||||
|
||||
Find the link to the Nuget package [here](https://www.nuget.org/packages/SabreTools.CommandLine).
|
||||
|
||||
For an example of a program implementing the library as well as the original source of this library code, see [SabreTools](https://github.com/SabreTools/SabreTools).
|
||||
|
||||
## Special Types
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace SabreTools.CommandLine.Test
|
||||
[InlineData(0, -1, "a a")]
|
||||
[InlineData(-1, 0, "a a")]
|
||||
[InlineData(0, 0, "a a")]
|
||||
[InlineData(2, 30, " a a")]
|
||||
[InlineData(2, 30, " a a")]
|
||||
[InlineData(4, 0, " a a")]
|
||||
public void FormatStandardTest(int pre, int midpoint, string expected)
|
||||
{
|
||||
|
||||
@@ -699,13 +699,14 @@ namespace SabreTools.CommandLine.Inputs
|
||||
{
|
||||
var output = new StringBuilder();
|
||||
|
||||
output.Append(CreatePadding(pre));
|
||||
output.Append(FormatFlags());
|
||||
|
||||
// Determine the midpoint padding size
|
||||
int midpointPadding = midpoint > 0 && output.Length < midpoint
|
||||
? midpoint - output.Length
|
||||
: 1;
|
||||
|
||||
output.Append(CreatePadding(pre));
|
||||
output.Append(FormatFlags());
|
||||
output.Append(CreatePadding(midpointPadding));
|
||||
output.Append(Description);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<Version>1.3.0</Version>
|
||||
<Version>1.3.1</Version>
|
||||
|
||||
<!-- Package Properties -->
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
|
||||
Reference in New Issue
Block a user