Skip to content

Commit

Permalink
Remove help description from all non-help-related models
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorKrolic committed Mar 9, 2024
1 parent 2454dca commit 2fa5aed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private static (OptionsInfo? OptionsInfo, OptionsHelpInfo? OptionsHelpInfo, Immu
var seenLongNames = new HashSet<string>();

var parameterMap = new Dictionary<int, ParameterInfo>();
var parameterHelpDescriptionsMap = new Dictionary<ParameterInfo, string?>();
var parametersProperties = new Dictionary<ParameterInfo, IPropertySymbol>();
var firstIndexWithNoError = new Dictionary<int, IPropertySymbol>();

Expand Down Expand Up @@ -328,8 +329,7 @@ private static (OptionsInfo? OptionsInfo, OptionsHelpInfo? OptionsHelpInfo, Immu
parseStrategy,
isRequired,
nullableUnderlyingType,
sequenceType,
helpDescription));
sequenceType));

optionsHelpBuilder.Add(new(
shortName,
Expand Down Expand Up @@ -396,10 +396,10 @@ private static (OptionsInfo? OptionsInfo, OptionsHelpInfo? OptionsHelpInfo, Immu
propertyType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat),
parseStrategy,
isRequired,
nullableUnderlyingType,
helpDescription);
nullableUnderlyingType);

parameterMap.Add(parameterIndex, parameterInfo);
parameterHelpDescriptionsMap.Add(parameterInfo, helpDescription);
parametersProperties.Add(parameterInfo, property);
}
}
Expand Down Expand Up @@ -444,8 +444,7 @@ private static (OptionsInfo? OptionsInfo, OptionsHelpInfo? OptionsHelpInfo, Immu
propertyName,
sequenceUnderlyingType!,
parseStrategy,
sequenceType,
helpDescription);
sequenceType);

remainingParametersHelpInfo = new(helpDescription);
}
Expand Down Expand Up @@ -475,7 +474,7 @@ private static (OptionsInfo? OptionsInfo, OptionsHelpInfo? OptionsHelpInfo, Immu

var parameterInfo = pair.Value;
parametersBuilder.Add(parameterInfo);
parametersHelpBuilder.Add(new(parameterInfo.Name, parameterInfo.IsRequired, parameterInfo.HelpDescription));
parametersHelpBuilder.Add(new(parameterInfo.Name, parameterInfo.IsRequired, parameterHelpDescriptionsMap[parameterInfo]));
lastSeenIndex = index;
}

Expand Down
3 changes: 1 addition & 2 deletions src/ArgumentParsing.Generators/Models/OptionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ internal sealed record OptionInfo(
ParseStrategy ParseStrategy,
bool IsRequired,
string? NullableUnderlyingType,
SequenceType SequenceType,
string? HelpDescription);
SequenceType SequenceType);
3 changes: 1 addition & 2 deletions src/ArgumentParsing.Generators/Models/ParameterInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ internal sealed record ParameterInfo(
string Type,
ParseStrategy ParseStrategy,
bool IsRequired,
string? NullableUnderlyingType,
string? HelpDescription);
string? NullableUnderlyingType);
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ internal sealed record RemainingParametersInfo(
string PropertyName,
string Type,
ParseStrategy ParseStrategy,
SequenceType SequenceType,
string? HelpDescription);
SequenceType SequenceType);

0 comments on commit 2fa5aed

Please sign in to comment.