mirror of
https://github.com/SabreTools/SabreTools.CommandLine.git
synced 2026-07-09 02:07:42 +00:00
Use less verbose "detailed" instead of "includeLongDescription"
This commit is contained in:
@@ -184,7 +184,7 @@ namespace SabreTools.CommandLine
|
||||
output.Add("Available options:");
|
||||
foreach (var input in _inputs.Values)
|
||||
{
|
||||
var outputs = input.FormatRecursive(pre: 2, midpoint: 30, includeLongDescription: true);
|
||||
var outputs = input.FormatRecursive(pre: 2, midpoint: 30, detailed: true);
|
||||
if (outputs != null)
|
||||
output.AddRange(outputs);
|
||||
}
|
||||
@@ -201,8 +201,8 @@ namespace SabreTools.CommandLine
|
||||
/// Output a single feature recursively
|
||||
/// </summary>
|
||||
/// <param name="featureName">Name of the feature to output information for, if possible</param>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
public void OutputFeatureHelp(string? featureName, bool includeLongDescription = false)
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
public void OutputFeatureHelp(string? featureName, bool detailed = false)
|
||||
{
|
||||
// If the feature name is null, empty, or just consisting of leading characters
|
||||
string trimmedName = featureName?.TrimStart('-', '/', '\\') ?? string.Empty;
|
||||
@@ -222,7 +222,7 @@ namespace SabreTools.CommandLine
|
||||
// Append the formatted text
|
||||
List<string> output = [];
|
||||
output.Add($"Available options for {featureName}:");
|
||||
output.AddRange(input.FormatRecursive(pre: 2, midpoint: 30, includeLongDescription));
|
||||
output.AddRange(input.FormatRecursive(pre: 2, midpoint: 30, detailed));
|
||||
|
||||
// Now write out everything in a staged manner
|
||||
WriteOutWithPauses(output);
|
||||
@@ -243,7 +243,7 @@ namespace SabreTools.CommandLine
|
||||
output.Add($"\"{featureName}\" not found. Did you mean:");
|
||||
foreach (string possible in startsWith)
|
||||
{
|
||||
output.AddRange(_inputs[possible].Format(pre: 2, midpoint: 30, includeLongDescription));
|
||||
output.AddRange(_inputs[possible].Format(pre: 2, midpoint: 30, detailed));
|
||||
}
|
||||
|
||||
// Now write out everything in a staged manner
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
// If we had something else after help
|
||||
if (args.Length > 1)
|
||||
{
|
||||
parentSet?.OutputFeatureHelp(args[1], includeLongDescription: true);
|
||||
parentSet?.OutputFeatureHelp(args[1], detailed: true);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -615,19 +615,19 @@ namespace SabreTools.CommandLine.Inputs
|
||||
/// <summary>
|
||||
/// Create formatted help text
|
||||
/// </summary>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <returns>Help text formatted as a list of strings</returns>
|
||||
public List<string> Format(bool includeLongDescription = false)
|
||||
=> Format(pre: 0, midpoint: 0, includeLongDescription);
|
||||
public List<string> Format(bool detailed = false)
|
||||
=> Format(pre: 0, midpoint: 0, detailed);
|
||||
|
||||
/// <summary>
|
||||
/// Create formatted help text
|
||||
/// </summary>
|
||||
/// <param name="pre">Positive number representing number of spaces to put in front of the feature</param>
|
||||
/// <param name="midpoint">Positive number representing the column where the description should start</param>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <returns>Help text formatted as a list of strings</returns>
|
||||
public List<string> Format(int pre, int midpoint, bool includeLongDescription = false)
|
||||
public List<string> Format(int pre, int midpoint, bool detailed = false)
|
||||
{
|
||||
// Create the output list
|
||||
List<string> outputList = [];
|
||||
@@ -636,7 +636,7 @@ namespace SabreTools.CommandLine.Inputs
|
||||
outputList.Add(FormatStandard(pre, midpoint));
|
||||
|
||||
// Add the long description, if needed
|
||||
if (includeLongDescription)
|
||||
if (detailed)
|
||||
outputList.AddRange(FormatLongDescription(pre, midpoint));
|
||||
|
||||
return outputList;
|
||||
@@ -645,20 +645,20 @@ namespace SabreTools.CommandLine.Inputs
|
||||
/// <summary>
|
||||
/// Create formatted help text including all children
|
||||
/// </summary>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <returns>Help text formatted as a list of strings</returns>
|
||||
public List<string> FormatRecursive(bool includeLongDescription = false)
|
||||
=> FormatRecursive(tabLevel: 0, pre: 0, midpoint: 0, includeLongDescription);
|
||||
public List<string> FormatRecursive(bool detailed = false)
|
||||
=> FormatRecursive(tabLevel: 0, pre: 0, midpoint: 0, detailed);
|
||||
|
||||
/// <summary>
|
||||
/// Create formatted help text including all children
|
||||
/// </summary>
|
||||
/// <param name="pre">Positive number representing number of spaces to put in front of the feature</param>
|
||||
/// <param name="midpoint">Positive number representing the column where the description should start</param>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <returns>Help text formatted as a list of strings</returns>
|
||||
public List<string> FormatRecursive(int pre, int midpoint, bool includeLongDescription = false)
|
||||
=> FormatRecursive(tabLevel: 0, pre, midpoint, includeLongDescription);
|
||||
public List<string> FormatRecursive(int pre, int midpoint, bool detailed = false)
|
||||
=> FormatRecursive(tabLevel: 0, pre, midpoint, detailed);
|
||||
|
||||
/// <summary>
|
||||
/// Pre-format the flags for output
|
||||
@@ -785,9 +785,9 @@ namespace SabreTools.CommandLine.Inputs
|
||||
/// <param name="tabLevel">Level of indentation for this feature</param>
|
||||
/// <param name="pre">Positive number representing number of spaces to put in front of the feature</param>
|
||||
/// <param name="midpoint">Positive number representing the column where the description should start</param>
|
||||
/// <param name="includeLongDescription">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <param name="detailed">True if the long description should be formatted and output, false otherwise</param>
|
||||
/// <returns>Help text formatted as a list of strings</returns>
|
||||
private List<string> FormatRecursive(int tabLevel, int pre = 0, int midpoint = 0, bool includeLongDescription = false)
|
||||
private List<string> FormatRecursive(int tabLevel, int pre = 0, int midpoint = 0, bool detailed = false)
|
||||
{
|
||||
// Create the output list
|
||||
List<string> outputList = [];
|
||||
@@ -805,13 +805,13 @@ namespace SabreTools.CommandLine.Inputs
|
||||
outputList.Add(FormatStandard(preAdjusted, midpointAdjusted));
|
||||
|
||||
// Add the long description, if needed
|
||||
if (includeLongDescription)
|
||||
if (detailed)
|
||||
outputList.AddRange(FormatLongDescription(preAdjusted, midpointAdjusted));
|
||||
|
||||
// Append all children recursively
|
||||
foreach (var feature in Children.Values)
|
||||
{
|
||||
outputList.AddRange(feature.FormatRecursive(tabLevel + 1, pre, midpoint, includeLongDescription));
|
||||
outputList.AddRange(feature.FormatRecursive(tabLevel + 1, pre, midpoint, detailed));
|
||||
}
|
||||
|
||||
return outputList;
|
||||
|
||||
Reference in New Issue
Block a user