Skip to content

Commit

Permalink
Rename ParameterNames to OptionNames
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Aug 11, 2021
1 parent b4ea069 commit 0486dcd
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 67 deletions.
4 changes: 2 additions & 2 deletions src/CommandLine/Commands/MSBuildWorkspaceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private static bool TryGetSingleInstance(out VisualStudioInstance instance)

if (instances == null)
{
WriteLine($"MSBuild location not found. Use option '-{OptionShortNames.MSBuildPath}, --{ParameterNames.MSBuildPath}' to specify MSBuild location", Verbosity.Quiet);
WriteLine($"MSBuild location not found. Use option '-{OptionShortNames.MSBuildPath}, --{OptionNames.MSBuildPath}' to specify MSBuild location", Verbosity.Quiet);
instance = null;
return false;
}
Expand All @@ -290,7 +290,7 @@ private static bool TryGetSingleInstance(out VisualStudioInstance instance)

} while (en.MoveNext());

WriteLine($"Use option '--{ParameterNames.MSBuildPath}' to specify MSBuild location", Verbosity.Quiet);
WriteLine($"Use option '--{OptionNames.MSBuildPath}' to specify MSBuild location", Verbosity.Quiet);
instance = null;
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Roslynator.CommandLine
{
internal static class ParameterNames
internal static class OptionNames
{
public const string Depth = "depth";
public const string Display = "display";
Expand Down
4 changes: 2 additions & 2 deletions src/CommandLine/Options/AbstractAnalyzeCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public abstract class AbstractAnalyzeCommandLineOptions : MSBuildCommandLineOpti
public IEnumerable<string> IgnoredDiagnostics { get; set; }

[Option(
longName: ParameterNames.SeverityLevel,
longName: OptionNames.SeverityLevel,
HelpText = "Defines minimally required severity for a diagnostic. Allowed values are hidden, info, warning or error. Default value is info.",
MetaValue = "<LEVEL>")]
public string SeverityLevel { get; set; }
Expand All @@ -52,7 +52,7 @@ public abstract class AbstractAnalyzeCommandLineOptions : MSBuildCommandLineOpti

internal bool TryParseDiagnosticSeverity(DiagnosticSeverity defaultValue, out DiagnosticSeverity value)
{
return ParseHelpers.TryParseOptionValueAsEnum(SeverityLevel, ParameterNames.SeverityLevel, out value, defaultValue);
return ParseHelpers.TryParseOptionValueAsEnum(SeverityLevel, OptionNames.SeverityLevel, out value, defaultValue);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public abstract class AbstractGenerateDocCommandLineOptions : MSBuildCommandLine
public string Output { get; set; }

[Option(
longName: ParameterNames.Depth,
longName: OptionNames.Depth,
HelpText = "Defines a depth of a documentation. Allowed values are member, type or namespace. Default value is member.",
MetaValue = "<DEPTH>")]
public string Depth { get; set; }
Expand All @@ -57,7 +57,7 @@ public abstract class AbstractGenerateDocCommandLineOptions : MSBuildCommandLine
public bool ScrollToContent { get; set; }

[Option(
longName: ParameterNames.Visibility,
longName: OptionNames.Visibility,
Default = nameof(Roslynator.Visibility.Public),
HelpText = "Defines a visibility of a type or a member. Allowed values are public, internal or private. Default value is public.",
MetaValue = "<VISIBILITY>")]
Expand Down
8 changes: 4 additions & 4 deletions src/CommandLine/Options/FindSymbolsCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public class FindSymbolsCommandLineOptions : MSBuildCommandLineOptions
[Option(longName: "ignore-generated-code")]
public bool IgnoreGeneratedCode { get; set; }

[Option(longName: ParameterNames.SymbolGroups)]
[Option(longName: OptionNames.SymbolGroups)]
public IEnumerable<string> SymbolGroups { get; set; }

[Option(longName: "unused-only")]
public bool UnusedOnly { get; set; }

[Option(longName: ParameterNames.Visibility)]
[Option(longName: OptionNames.Visibility)]
public IEnumerable<string> Visibility { get; set; }

[Option(longName: "with-attributes")]
Expand All @@ -37,10 +37,10 @@ public class FindSymbolsCommandLineOptions : MSBuildCommandLineOptions
[Option(longName: "without-attributes")]
public IEnumerable<string> WithoutAttributes { get; set; }

[Option(longName: ParameterNames.WithFlags)]
[Option(longName: OptionNames.WithFlags)]
public IEnumerable<string> WithFlags { get; set; }

[Option(longName: ParameterNames.WithoutFlags)]
[Option(longName: OptionNames.WithoutFlags)]
public IEnumerable<string> WithoutFlags { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/CommandLine/Options/FixCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class FixCommandLineOptions : AbstractAnalyzeCommandLineOptions
public string FileBanner { get; set; }

[Option(
longName: ParameterNames.FixScope,
longName: OptionNames.FixScope,
HelpText = "Defines fix scope. Allowed values are project or document. Default value is project.",
MetaValue = "<FIX_SCOPE>")]
public string FixScope { get; set; }
Expand Down
14 changes: 7 additions & 7 deletions src/CommandLine/Options/GenerateDocCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ public class GenerateDocCommandLineOptions : AbstractGenerateDocCommandLineOptio
public IEnumerable<string> AdditionalXmlDocumentation { get; set; }

[Option(
longName: ParameterNames.IgnoredMemberParts,
longName: OptionNames.IgnoredMemberParts,
HelpText = "Defines parts of a member documentation that should be excluded. Allowed values are overloads, containing-type, containing-assembly, obsolete-message, summary, declaration, type-parameters, parameters, return-value, implements, attributes, exceptions, examples, remarks and see-also.",
MetaValue = "<IGNORED_MEMBER_PARTS>")]
public IEnumerable<string> IgnoredMemberParts { get; set; }

[Option(
longName: ParameterNames.IgnoredNamespaceParts,
longName: OptionNames.IgnoredNamespaceParts,
HelpText = "Defines parts of a namespace documentation that should be excluded. Allowed values are content, containing-namespace, summary, examples, remarks, classes, structs, interfaces, enums, delegates and see-also.",
MetaValue = "<IGNORED_NAMESPACE_PARTS>")]
public IEnumerable<string> IgnoredNamespaceParts { get; set; }

[Option(
longName: ParameterNames.IgnoredRootParts,
longName: OptionNames.IgnoredRootParts,
HelpText = "Defines parts of a root documentation that should be excluded. Allowed values are content, namespaces, class-hierarchy, types and other.",
MetaValue = "<IGNORED_ROOT_PARTS>")]
public IEnumerable<string> IgnoredRootParts { get; set; }

[Option(
longName: ParameterNames.IgnoredTypeParts,
longName: OptionNames.IgnoredTypeParts,
HelpText = "Defines parts of a type documentation that should be excluded. Allowed values are content, containing-namespace, containing-assembly, obsolete-message, summary, declaration, type-parameters, parameters, return-value, inheritance, attributes, derived, implements, examples, remarks, constructors, fields, indexers, properties, methods, operators, events, explicit-interface-implementations, extension-methods, classes, structs, interfaces, enums, delegates and see-also.",
MetaValue = "<IGNORED_TYPE_PARTS>")]
public IEnumerable<string> IgnoredTypeParts { get; set; }
Expand All @@ -46,7 +46,7 @@ public class GenerateDocCommandLineOptions : AbstractGenerateDocCommandLineOptio
public bool IncludeAllDerivedTypes { get; set; }

[Option(
longName: ParameterNames.IncludeContainingNamespace,
longName: OptionNames.IncludeContainingNamespace,
HelpText = "Defines parts of a documentation that should include containing namespace. Allowed values are class-hierarchy, containing-type, parameter, return-type, base-type, attribute, derived-type, implemented-interface, implemented-member, exception, see-also and all.",
MetaValue = "<INCLUDE_CONTAINING_NAMESPACE>")]
public IEnumerable<string> IncludeContainingNamespace { get; set; }
Expand All @@ -62,7 +62,7 @@ public class GenerateDocCommandLineOptions : AbstractGenerateDocCommandLineOptio
public bool IncludeInheritedInterfaceMembers { get; set; }

[Option(
longName: ParameterNames.IncludeSystemNamespace,
longName: OptionNames.IncludeSystemNamespace,
HelpText = "Indicates whether namespace should be included when a type is directly contained in namespace 'System'.")]
public bool IncludeSystemNamespace { get; set; }

Expand Down Expand Up @@ -106,7 +106,7 @@ public class GenerateDocCommandLineOptions : AbstractGenerateDocCommandLineOptio
public bool OmitInheritedAttributes { get; set; }

[Option(
longName: ParameterNames.OmitMemberParts,
longName: OptionNames.OmitMemberParts,
HelpText = "Defines parts of member definition that should be omitted. Allowed values are constant-value, implements, inherited-from and overrides.")]
public IEnumerable<string> OmitMemberParts { get; set; }

Expand Down
6 changes: 3 additions & 3 deletions src/CommandLine/Options/GenerateDocRootCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ namespace Roslynator.CommandLine
public class GenerateDocRootCommandLineOptions : AbstractGenerateDocCommandLineOptions
{
[Option(
longName: ParameterNames.IncludeContainingNamespace,
longName: OptionNames.IncludeContainingNamespace,
HelpText = "Defines parts of a documentation that should include containing namespace. Allowed values are class-hierarchy.",
MetaValue = "<INCLUDE_CONTAINING_NAMESPACE>")]
public IEnumerable<string> IncludeContainingNamespace { get; set; }

[Option(
longName: ParameterNames.IncludeSystemNamespace,
longName: OptionNames.IncludeSystemNamespace,
HelpText = "Indicates whether namespace should be included when a type is directly contained in namespace 'System'.")]
public bool IncludeSystemNamespace { get; set; }

Expand All @@ -26,7 +26,7 @@ public class GenerateDocRootCommandLineOptions : AbstractGenerateDocCommandLineO
public IEnumerable<string> IgnoredParts { get; set; }

[Option(
longName: ParameterNames.RootDirectoryUrl,
longName: OptionNames.RootDirectoryUrl,
HelpText = "Defines a relative url to the documentation root directory.",
MetaValue = "<ROOT_DIRECTORY_URL>")]
public string RootDirectoryUrl { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class GenerateSourceReferencesCommandLineOptions : MSBuildCommandLineOpti
public string Commit { get; set; }

[Option(
longName: ParameterNames.Depth,
longName: OptionNames.Depth,
HelpText = "Defines a depth of a documentation. Allowed values are member, type or namespace. Default value is member.",
MetaValue = "<DEPTH>")]
public string Depth { get; set; }
Expand All @@ -57,7 +57,7 @@ public class GenerateSourceReferencesCommandLineOptions : MSBuildCommandLineOpti
public string RepositoryType { get; set; }

[Option(
longName: ParameterNames.Visibility,
longName: OptionNames.Visibility,
Default = nameof(Roslynator.Visibility.Public),
HelpText = "Defines a visibility of a type or a member. Allowed values are public, internal or private. Default value is public.",
MetaValue = "<VISIBILITY>")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ListReferencesCommandLineOptions : MSBuildCommandLineOptions
public string Display { get; set; }

[Option(
longName: ParameterNames.Type,
longName: OptionNames.Type,
HelpText = "Defines a type of a reference. Allowed values are dll and project.")]
public IEnumerable<string> Type { get; set; }
}
Expand Down
10 changes: 5 additions & 5 deletions src/CommandLine/Options/ListSymbolsCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class ListSymbolsCommandLineOptions : MSBuildCommandLineOptions
public IEnumerable<string> Paths { get; set; }

[Option(
longName: ParameterNames.Depth,
longName: OptionNames.Depth,
HelpText = "Defines a depth of a list of symbols. Allowed values are member, type or namespace. Default value is member.",
MetaValue = "<DEPTH>")]
public string Depth { get; set; }
Expand All @@ -28,7 +28,7 @@ public class ListSymbolsCommandLineOptions : MSBuildCommandLineOptions
public bool EmptyLineBetweenMembers { get; set; }

[Option(
longName: ParameterNames.WrapList,
longName: OptionNames.WrapList,
HelpText = "Specifies syntax lists that should be wrapped. Allowed values are attributes, parameters, base-types and constraints.")]
public IEnumerable<string> WrapList { get; set; }

Expand All @@ -44,7 +44,7 @@ public class ListSymbolsCommandLineOptions : MSBuildCommandLineOptions
public IEnumerable<string> IgnoredAttributes { get; set; }

[Option(
longName: ParameterNames.IgnoredParts,
longName: OptionNames.IgnoredParts,
HelpText = "Defines parts of a symbol definition that should be excluded. Allowed values are assemblies, containing-namespace, containing-namespace-in-type-hierarchy, attributes, assembly-attributes, attribute-arguments, accessibility, modifiers, parameter-name, parameter-default-value, base-type, base-interfaces, constraints, trailing-semicolon, trailing-comma.",
MetaValue = "<IGNORED_PARTS>")]
public IEnumerable<string> IgnoredParts { get; set; }
Expand Down Expand Up @@ -74,7 +74,7 @@ public class ListSymbolsCommandLineOptions : MSBuildCommandLineOptions
public string HierarchyRoot { get; set; }

[Option(
longName: ParameterNames.Layout,
longName: OptionNames.Layout,
HelpText = "Defines layout of a list of symbol definitions. Allowed values are namespace-list, namespace-hierarchy or type-hierarchy. Default value is namespace-list.")]
public string Layout { get; set; }

Expand All @@ -97,7 +97,7 @@ public class ListSymbolsCommandLineOptions : MSBuildCommandLineOptions
#endif

[Option(
longName: ParameterNames.Visibility,
longName: OptionNames.Visibility,
Default = new string[] { nameof(Roslynator.Visibility.Public) },
HelpText = "Defines one or more visibility of a type or a member. Allowed values are public, internal or private.",
MetaValue = "<VISIBILITY>")]
Expand Down
8 changes: 4 additions & 4 deletions src/CommandLine/Options/MSBuildCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Roslynator.CommandLine
public abstract class MSBuildCommandLineOptions : AbstractCommandLineOptions
{
[Option(
longName: ParameterNames.IgnoredProjects,
longName: OptionNames.IgnoredProjects,
HelpText = "Defines projects that should not be analyzed.",
MetaValue = "<PROJECT_NAME>")]
public IEnumerable<string> IgnoredProjects { get; set; }
Expand All @@ -23,13 +23,13 @@ public abstract class MSBuildCommandLineOptions : AbstractCommandLineOptions

[Option(
shortName: OptionShortNames.MSBuildPath,
longName: ParameterNames.MSBuildPath,
longName: OptionNames.MSBuildPath,
HelpText = "Defines a path to MSBuild. This option must be specified if there are multiple locations of MSBuild (usually multiple installations of Visual Studio).",
MetaValue = "<MSBUILD_PATH>")]
public string MSBuildPath { get; set; }

[Option(
longName: ParameterNames.Projects,
longName: OptionNames.Projects,
HelpText = "Defines projects that should be analyzed.",
MetaValue = "<PROJECT_NAME>")]
public IEnumerable<string> Projects { get; set; }
Expand Down Expand Up @@ -65,7 +65,7 @@ internal bool TryGetProjectFilter(out ProjectFilter projectFilter)
if (Projects?.Any() == true
&& IgnoredProjects?.Any() == true)
{
Logger.WriteLine($"Cannot specify both '{ParameterNames.Projects}' and '{ParameterNames.IgnoredProjects}'.", Roslynator.Verbosity.Quiet);
Logger.WriteLine($"Cannot specify both '{OptionNames.Projects}' and '{OptionNames.IgnoredProjects}'.", Roslynator.Verbosity.Quiet);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/CommandLine/Options/MigrateCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal sealed class MigrateCommandLineOptions : AbstractCommandLineOptions
public string Identifier { get; set; }

[Option(
longName: ParameterNames.TargetVersion,
longName: OptionNames.TargetVersion,
Required = true,
HelpText = "A package version to migrate to.",
MetaValue = "<VERSION>")]
Expand Down
6 changes: 3 additions & 3 deletions src/CommandLine/Options/SpellcheckCommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class SpellcheckCommandLineOptions : MSBuildCommandLineOptions
public bool DryRun { get; set; }

[Option(
longName: ParameterNames.IgnoredScope,
longName: OptionNames.IgnoredScope,
HelpText = "Defines syntax that should not be analyzed. Allowed values are comment, type, member, local, parameter, non-symbol and symbol.",
MetaValue = "<SCOPE>")]
public IEnumerable<string> IgnoredScope { get; set; }
Expand All @@ -54,13 +54,13 @@ public sealed class SpellcheckCommandLineOptions : MSBuildCommandLineOptions
public int MinWordLength { get; set; }

[Option(
longName: ParameterNames.Scope,
longName: OptionNames.Scope,
HelpText = "Defines syntax that should be analyzed. Allowed values are comment, type, member, local, parameter, non-symbol and symbol.",
MetaValue = "<SCOPE>")]
public IEnumerable<string> Scope { get; set; }

[Option(
longName: ParameterNames.Visibility,
longName: OptionNames.Visibility,
Default = nameof(Roslynator.Visibility.Public),
HelpText = "Defines a maximal visibility of a symbol to be fixable. Allowed values are public, internal or private. Default value is public.",
MetaValue = "<VISIBILITY>")]
Expand Down
Loading

0 comments on commit 0486dcd

Please sign in to comment.