Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commands for generating shell completion scripts + statically-generated bash script #42416

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a6d22de
Spike out initial completion script emit commands
baronfel Jul 27, 2024
bbc0196
Update contents to include locations and commented instructions where…
baronfel Jul 28, 2024
d9fca03
Complete rewrite to support dynamic completions
baronfel Jul 28, 2024
965f78a
Refactor to make certain scary portions of the generation have nicer …
baronfel Jul 28, 2024
a862bbd
Enhancement: do not emit completions for option arguments for flag-st…
baronfel Jul 28, 2024
0008709
Optimize static completions for bash: don't emit option completions f…
baronfel Jul 28, 2024
19de5cd
Completion optimization - don't emit option handler stanzas if they a…
baronfel Jul 28, 2024
1bed02b
Completion optimization: mark several flag-style commands as Arity ze…
baronfel Jul 28, 2024
63078e9
Completions optimization: mark many flag-style options as Arity Zero
baronfel Jul 28, 2024
c8f5d30
Fix accidental zero-arity arguments in tool install and restore
baronfel Jul 28, 2024
d96cab8
update baselines for new completions command
baronfel Jul 28, 2024
4074cbd
strip odd help option aliases, suggest only best option name, and ens…
baronfel Jul 31, 2024
9ceeaa9
Add tests for shell completion helpers
baronfel Jul 31, 2024
8cc761b
WIP test placeholders
baronfel Dec 20, 2024
273f96b
Rename for consistency
baronfel Dec 20, 2024
0ed9b30
Initial powershell static completions provider
baronfel Dec 22, 2024
836a845
Powershell: Generate dynamic completion lists for arguments where pos…
baronfel Dec 23, 2024
c2dc712
Extract out implementation to separate project to potentially ship as…
baronfel Dec 25, 2024
9499489
Initial basic snapshot tests for bash and pwsh
baronfel Dec 25, 2024
2cfe437
Minor test framework refactor
baronfel Dec 29, 2024
904a3a2
Working zsh completions (including testing on dotnet)
baronfel Dec 29, 2024
6183d8d
ZSH: fix completions for static argument completions with descriptions
baronfel Dec 30, 2024
7d8df2e
Zsh: support for dynamic completions of options and arguments
baronfel Dec 30, 2024
7547923
Code review fixes and renames from @Forgind
baronfel Dec 31, 2024
635aec6
Remove unused option to minimize diff
baronfel Dec 31, 2024
5815c78
Fix two logical test failures
baronfel Dec 31, 2024
0e9d2f4
Remove unnecessary arity and hidden flags from arguments where that m…
baronfel Dec 31, 2024
4592a02
Update Verify packages to hopefully get around some initialization si…
baronfel Dec 31, 2024
fa01dc9
Try to work around Verify directory usage in CI
baronfel Jan 1, 2025
8aabe7a
Minor rename to align type name with file name
baronfel Jan 1, 2025
d8e9388
Add dotnet CLI generate script approval tests to the CLI-level tests
baronfel Jan 1, 2025
0f483ad
Try to be even more explicit
baronfel Jan 1, 2025
4fee78c
Apply bash env change from @am11 and update snapshots
baronfel Jan 1, 2025
ad46fab
try to fix errant path computation in tests
baronfel Jan 2, 2025
c38887b
make the completions command re-nameable
baronfel Jan 6, 2025
a3866e4
update verify extensions to forward sourceFile paths
baronfel Jan 11, 2025
5745044
Remove DerivePathInfo in tests
baronfel Jan 11, 2025
a9b1ef2
try to debug directory creations
baronfel Jan 13, 2025
9246158
even more diagnostics
baronfel Jan 13, 2025
e2aae95
try another way of finding paths?
baronfel Jan 15, 2025
bb41b58
fix XMLdoc tags to green up the builds
baronfel Jan 15, 2025
00429e5
re-set DervicePathInfo
baronfel Jan 15, 2025
ad86f88
remove unused code
baronfel Jan 15, 2025
4500f4d
update .NET CLI snapshot tests similarly to standlone tests
baronfel Jan 16, 2025
0337801
Updates to snapshots for new dotnet nuget why documentation
baronfel Jan 16, 2025
7d1f13a
Unify newline handling in powershell for very long descriptions
baronfel Jan 16, 2025
e649e97
Make local builds use nicer Verify diff compares
baronfel Jan 27, 2025
c33ee44
Add localizations for the new strings in the completion and generatio…
baronfel Jan 27, 2025
fd64dc2
Remove CI-detection codepaths in favor of DiffEngine's detection
baronfel Jan 27, 2025
161cc80
Better help descriptions and guidance for the powershell script provider
baronfel Jan 27, 2025
6171580
Generate better completions for the shell arguments
baronfel Jan 27, 2025
21183dd
Update the PowershellShellProvider to use @MiYanni's code and update …
baronfel Jan 27, 2025
ed98f1d
Try this detection instead
baronfel Jan 27, 2025
b2d326b
Update completions for underlying changes from main
baronfel Feb 27, 2025
01c2f04
Get some test-level output logging about runtime state
baronfel Feb 27, 2025
0b45974
dump logs to see why my checks aren't working
baronfel Feb 27, 2025
5c0ee47
Yield to the borg and onboard to the helix test infra
baronfel Feb 27, 2025
474ba26
try to detect helix
baronfel Feb 27, 2025
b5d51f2
always copy snapshot contents to output directory
baronfel Feb 28, 2025
f9428c6
try to make the scripts not end up in packages?
baronfel Feb 28, 2025
ec777a4
Update assertions due to work merged into main
baronfel Feb 28, 2025
e7f9e7b
Update src/System.CommandLine.StaticCompletions/Resources/Strings.resx
baronfel Feb 28, 2025
85366c3
add missing translations
baronfel Feb 28, 2025
40778da
Add some diagnostics for the standalone completions tests
baronfel Mar 3, 2025
1692a60
fix casing on ps1 script after string change
baronfel Mar 3, 2025
28b9ca4
try this way of detecting CI stuff
baronfel Mar 3, 2025
571db7c
try more helix detection
baronfel Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eng/dependabot/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

<ItemGroup>
<!--Test dependencies-->
<PackageVersion Include="Verify.Xunit" Version="25.0.2" />
<PackageVersion Include="Verify.DiffPlex" Version="3.0.0" />
<PackageVersion Include="Verify.Xunit" Version="28.7.0" />
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
<PackageVersion Include="FakeItEasy" Version="8.0.0" />
<PackageVersion Include="Wcwidth.Sources" Version="2.0.0" />
</ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions sdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.DotNet.HotReload.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.HotReload.Agent.Package", "src\BuiltInTools\HotReloadAgent\Microsoft.DotNet.HotReload.Agent.Package.csproj", "{2FF79F82-60C1-349A-4726-7783D5A6D5DF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.CommandLine.StaticCompletions", "src\System.CommandLine.StaticCompletions\System.CommandLine.StaticCompletions.csproj", "{B84E0837-40AF-484E-A71D-941595568BE7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.CommandLine.StaticCompletions.Tests", "test\System.CommandLine.StaticCompletions.Tests\System.CommandLine.StaticCompletions.Tests.csproj", "{0C13E7D0-5335-4D60-B0F2-12595E8FC451}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DotNet.HotReload.Agent.PipeRpc.Package", "src\BuiltInTools\HotReloadAgent.PipeRpc\Microsoft.DotNet.HotReload.Agent.PipeRpc.Package.csproj", "{692B71D8-9C31-D1EE-6C1B-570A12B18E39}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.DotNet.HotReload.Agent.PipeRpc", "src\BuiltInTools\HotReloadAgent.PipeRpc\Microsoft.DotNet.HotReload.Agent.PipeRpc.shproj", "{FA3C7F91-42A2-45AD-897C-F646B081016C}"
Expand Down Expand Up @@ -967,6 +971,14 @@ Global
{2FF79F82-60C1-349A-4726-7783D5A6D5DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FF79F82-60C1-349A-4726-7783D5A6D5DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FF79F82-60C1-349A-4726-7783D5A6D5DF}.Release|Any CPU.Build.0 = Release|Any CPU
{B84E0837-40AF-484E-A71D-941595568BE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B84E0837-40AF-484E-A71D-941595568BE7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B84E0837-40AF-484E-A71D-941595568BE7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B84E0837-40AF-484E-A71D-941595568BE7}.Release|Any CPU.Build.0 = Release|Any CPU
{0C13E7D0-5335-4D60-B0F2-12595E8FC451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C13E7D0-5335-4D60-B0F2-12595E8FC451}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C13E7D0-5335-4D60-B0F2-12595E8FC451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C13E7D0-5335-4D60-B0F2-12595E8FC451}.Release|Any CPU.Build.0 = Release|Any CPU
{692B71D8-9C31-D1EE-6C1B-570A12B18E39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{692B71D8-9C31-D1EE-6C1B-570A12B18E39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{692B71D8-9C31-D1EE-6C1B-570A12B18E39}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -1151,6 +1163,8 @@ Global
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44} = {3FA6F1CB-295B-4414-B18F-93845917A8CD}
{418B10BD-CA42-49F3-8F4A-D8CC90C8A17D} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
{2FF79F82-60C1-349A-4726-7783D5A6D5DF} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
{B84E0837-40AF-484E-A71D-941595568BE7} = {22AB674F-ED91-4FBC-BFEE-8A1E82F9F05E}
{0C13E7D0-5335-4D60-B0F2-12595E8FC451} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
{692B71D8-9C31-D1EE-6C1B-570A12B18E39} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
{FA3C7F91-42A2-45AD-897C-F646B081016C} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
{3DF5A9B8-6F90-4CFB-4518-0E97982B6748} = {71A9F549-0EB6-41F9-BC16-4A6C5007FC91}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ internal static CliOption<bool> CreateColumnsAllOption()
{
return new("--columns-all")
{
Arity = new ArgumentArity(0, 1),
Arity = ArgumentArity.Zero,
Description = SymbolStrings.Option_ColumnsAll
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal BaseListCommand(
internal static CliOption<bool> IgnoreConstraintsOption { get; } = new("--ignore-constraints")
{
Description = SymbolStrings.ListCommand_Option_IgnoreConstraints,
Arity = new ArgumentArity(0, 1)
Arity = ArgumentArity.Zero
};

internal static CliArgument<string> NameArgument { get; } = new("template-name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public UpdateCommand(

internal static CliOption<bool> CheckOnlyOption { get; } = new("--check-only", "--dry-run")
{
Description = SymbolStrings.Command_Update_Option_CheckOnly
Description = SymbolStrings.Command_Update_Option_CheckOnly,
Arity = ArgumentArity.Zero
};

protected override async Task<NewCommandStatus> ExecuteAsync(
Expand Down
66 changes: 45 additions & 21 deletions src/Cli/dotnet/CommonOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.CommandLine;
using System.CommandLine.Completions;
using System.CommandLine.Parsing;
using System.CommandLine.StaticCompletions;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools;
using Microsoft.DotNet.Tools.Common;
Expand Down Expand Up @@ -36,13 +37,13 @@ internal static class CommonOptions
}.ForwardAsSingle(o => $"-verbosity:{o}");

public static CliOption<string> FrameworkOption(string description) =>
new ForwardedOption<string>("--framework", "-f")
new DynamicForwardedOption<string>("--framework", "-f")
{
Description = description,
HelpName = CommonLocalizableStrings.FrameworkArgumentName

}.ForwardAsSingle(o => $"-property:TargetFramework={o}")
.AddCompletions(Complete.TargetFrameworksFromProjectFile);
}
.AddCompletions(Complete.TargetFrameworksFromProjectFile)
.ForwardAsSingle(o => $"-property:TargetFramework={o}");

public static CliOption<string> ArtifactsPathOption =
new ForwardedOption<string>(
Expand All @@ -64,14 +65,14 @@ public static IEnumerable<string> RuntimeArgFunc(string rid)
}

public static CliOption<string> RuntimeOption =
new ForwardedOption<string>("--runtime", "-r")
new DynamicForwardedOption<string>("--runtime", "-r")
{
HelpName = RuntimeArgName
}.ForwardAsMany(RuntimeArgFunc)
.AddCompletions(Complete.RunTimesFromProjectFile);

public static CliOption<string> LongFormRuntimeOption =
new ForwardedOption<string>("--runtime")
new DynamicForwardedOption<string>("--runtime")
{
HelpName = RuntimeArgName
}.ForwardAsMany(RuntimeArgFunc)
Expand All @@ -80,11 +81,12 @@ public static IEnumerable<string> RuntimeArgFunc(string rid)
public static CliOption<bool> CurrentRuntimeOption(string description) =>
new ForwardedOption<bool>("--use-current-runtime", "--ucr")
{
Description = description
Description = description,
Arity = ArgumentArity.Zero
}.ForwardAs("-property:UseCurrentRuntimeIdentifier=True");

public static CliOption<string> ConfigurationOption(string description) =>
new ForwardedOption<string>("--configuration", "-c")
new DynamicForwardedOption<string>("--configuration", "-c")
{
Description = description,
HelpName = CommonLocalizableStrings.ConfigurationArgumentName
Expand All @@ -110,25 +112,22 @@ public static CliArgument<string> DefaultToCurrentDirectory(this CliArgument<str

public static CliOption<bool> NoRestoreOption = new ForwardedOption<bool>("--no-restore")
{
Description = CommonLocalizableStrings.NoRestoreDescription
Description = CommonLocalizableStrings.NoRestoreDescription,
Arity = ArgumentArity.Zero
}.ForwardAs("-restore:false");

public static CliOption<bool> InteractiveMsBuildForwardOption =
new ForwardedOption<bool>("--interactive")
{
Description = CommonLocalizableStrings.CommandInteractiveOptionDescription
Description = CommonLocalizableStrings.CommandInteractiveOptionDescription,
Arity = ArgumentArity.Zero
}.ForwardAs("-property:NuGetInteractive=true");

public static CliOption<bool> InteractiveOption =
new("--interactive")
{
Description = CommonLocalizableStrings.CommandInteractiveOptionDescription
};

public static CliOption<bool> DisableBuildServersOption =
new ForwardedOption<bool>("--disable-build-servers")
{
Description = CommonLocalizableStrings.DisableBuildServersOptionDescription
Description = CommonLocalizableStrings.DisableBuildServersOptionDescription,
Arity = ArgumentArity.Zero
}
.ForwardAsMany(_ => ["--property:UseRazorBuildServer=false", "--property:UseSharedCompilation=false", "/nodeReuse:false"]);

Expand Down Expand Up @@ -158,7 +157,10 @@ internal static string ArchOptionValue(ParseResult parseResult) =>
HelpName = CommonLocalizableStrings.OSArgumentName
}.SetForwardingFunction(ResolveOsOptionToRuntimeIdentifier);

public static CliOption<bool> DebugOption = new("--debug");
public static CliOption<bool> DebugOption = new("--debug")
{
Arity = ArgumentArity.Zero,
};

public static CliOption<bool> SelfContainedOption =
new ForwardedOption<bool>("--self-contained", "--sc")
Expand All @@ -170,10 +172,10 @@ internal static string ArchOptionValue(ParseResult parseResult) =>
public static CliOption<bool> NoSelfContainedOption =
new ForwardedOption<bool>("--no-self-contained")
{
Description = CommonLocalizableStrings.FrameworkDependentOptionDescription
Description = CommonLocalizableStrings.FrameworkDependentOptionDescription,
Arity = ArgumentArity.Zero
}
// Flip the argument so that if this option is specified we get selfcontained=false
.SetForwardingFunction((arg, p) => ForwardSelfContainedOptions(!arg, p));
.SetForwardingFunction((_, p) => ForwardSelfContainedOptions(false, p));

public static readonly CliOption<IReadOnlyDictionary<string, string>> EnvOption = new("--environment", "-e")
{
Expand Down Expand Up @@ -317,6 +319,18 @@ internal static CliArgument<T> AddCompletions<T>(this CliArgument<T> argument, F
argument.CompletionSources.Add(completionSource);
return argument;
}

internal static DynamicOption<T> AddCompletions<T>(this DynamicOption<T> option, Func<CompletionContext, IEnumerable<CompletionItem>> completionSource)
{
option.CompletionSources.Add(completionSource);
return option;
}

internal static DynamicForwardedOption<T> AddCompletions<T>(this DynamicForwardedOption<T> option, Func<CompletionContext, IEnumerable<CompletionItem>> completionSource)
{
option.CompletionSources.Add(completionSource);
return option;
}
}

public enum VerbosityOptions
Expand All @@ -332,4 +346,14 @@ public enum VerbosityOptions
diagnostic,
diag
}

public class DynamicOption<T> : CliOption<T>, IDynamicOption
{
public DynamicOption(string name, params string[] aliases) : base(name, aliases) { }
}

public class DynamicArgument<T> : CliArgument<T>, IDynamicArgument
{
public DynamicArgument(string name) : base(name) { }
}
}
5 changes: 3 additions & 2 deletions src/Cli/dotnet/CommonOptionsFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ namespace Microsoft.DotNet.Cli
internal static class CommonOptionsFactory
{
/// <summary>
/// Creates common diagnositcs option (-d|--diagnostics).
/// Creates common diagnostics option (-d|--diagnostics).
/// </summary>
public static CliOption<bool> CreateDiagnosticsOption(bool recursive) => new("--diagnostics", "-d")
{
Description = Tools.Help.LocalizableStrings.SDKDiagnosticsCommandDefinition,
Recursive = recursive
Recursive = recursive,
Arity = ArgumentArity.Zero
};
}
}
11 changes: 11 additions & 0 deletions src/Cli/dotnet/OptionForwardingExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.CommandLine;
using System.CommandLine.Parsing;
using System.CommandLine.StaticCompletions;

namespace Microsoft.DotNet.Cli
{
Expand Down Expand Up @@ -149,4 +150,14 @@ public Func<ParseResult, IEnumerable<string>> GetForwardingFunction()
return ForwardingFunction;
}
}

public class DynamicForwardedOption<T> : ForwardedOption<T>, IDynamicOption
{
public DynamicForwardedOption(string name, Func<ArgumentResult, T> parseArgument, string description = null)
: base(name, parseArgument, description)
{
}

public DynamicForwardedOption(string name, params string[] aliases) : base(name, aliases) { }
}
}
23 changes: 18 additions & 5 deletions src/Cli/dotnet/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,31 @@ public static class Parser
HelpCommandParser.GetCommand(),
SdkCommandParser.GetCommand(),
InstallSuccessCommand,
WorkloadCommandParser.GetCommand()
WorkloadCommandParser.GetCommand(),
new System.CommandLine.StaticCompletions.CompletionsCommand()
};

public static readonly CliOption<bool> DiagOption = CommonOptionsFactory.CreateDiagnosticsOption(recursive: false);

public static readonly CliOption<bool> VersionOption = new("--version");
public static readonly CliOption<bool> VersionOption = new("--version")
{
Arity = ArgumentArity.Zero,
};

public static readonly CliOption<bool> InfoOption = new("--info");
public static readonly CliOption<bool> InfoOption = new("--info")
{
Arity = ArgumentArity.Zero,
};

public static readonly CliOption<bool> ListSdksOption = new("--list-sdks");
public static readonly CliOption<bool> ListSdksOption = new("--list-sdks")
{
Arity = ArgumentArity.Zero,
};

public static readonly CliOption<bool> ListRuntimesOption = new("--list-runtimes");
public static readonly CliOption<bool> ListRuntimesOption = new("--list-runtimes")
{
Arity = ArgumentArity.Zero,
};

// Argument
public static readonly CliArgument<string> DotnetSubCommand = new("subcommand") { Arity = ArgumentArity.ZeroOrOne, Hidden = true };
Expand Down
12 changes: 9 additions & 3 deletions src/Cli/dotnet/commands/dotnet-build/BuildCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@ internal static class BuildCommandParser
HelpName = LocalizableStrings.OutputOptionName
}.ForwardAsOutputPath("OutputPath");

public static readonly CliOption<bool> NoIncrementalOption = new("--no-incremental") { Description = LocalizableStrings.NoIncrementalOptionDescription };
public static readonly CliOption<bool> NoIncrementalOption = new("--no-incremental")
{
Description = LocalizableStrings.NoIncrementalOptionDescription,
Arity = ArgumentArity.Zero
};

public static readonly CliOption<bool> NoDependenciesOption = new ForwardedOption<bool>("--no-dependencies")
{
Description = LocalizableStrings.NoDependenciesOptionDescription
Description = LocalizableStrings.NoDependenciesOptionDescription,
Arity = ArgumentArity.Zero
}.ForwardAs("-property:BuildProjectReferences=false");

public static readonly CliOption<bool> NoLogoOption = new ForwardedOption<bool>("--nologo")
{
Description = LocalizableStrings.CmdNoLogo
Description = LocalizableStrings.CmdNoLogo,
Arity = ArgumentArity.Zero
}.ForwardAs("-nologo");

public static readonly CliOption<bool> NoRestoreOption = CommonOptions.NoRestoreOption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@ namespace Microsoft.DotNet.Cli
{
internal static class ServerShutdownCommandParser
{
public static readonly CliOption<bool> MSBuildOption = new("--msbuild") { Description = LocalizableStrings.MSBuildOptionDescription };
public static readonly CliOption<bool> VbcsOption = new("--vbcscompiler") { Description = LocalizableStrings.VBCSCompilerOptionDescription };
public static readonly CliOption<bool> RazorOption = new("--razor") { Description = LocalizableStrings.RazorOptionDescription };
public static readonly CliOption<bool> MSBuildOption = new("--msbuild")
{
Description = LocalizableStrings.MSBuildOptionDescription,
Arity = ArgumentArity.Zero
};

public static readonly CliOption<bool> VbcsOption = new("--vbcscompiler")
{
Description = LocalizableStrings.VBCSCompilerOptionDescription,
Arity = ArgumentArity.Zero
};

public static readonly CliOption<bool> RazorOption = new("--razor")
{
Description = LocalizableStrings.RazorOptionDescription,
Arity = ArgumentArity.Zero
};

private static readonly CliCommand Command = ConstructCommand();

Expand Down
3 changes: 2 additions & 1 deletion src/Cli/dotnet/commands/dotnet-clean/CleanCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ internal static class CleanCommandParser

public static readonly CliOption<bool> NoLogoOption = new ForwardedOption<bool>("--nologo")
{
Description = LocalizableStrings.CmdNoLogo
Description = LocalizableStrings.CmdNoLogo,
Arity = ArgumentArity.Zero
}.ForwardAs("-nologo");

public static readonly CliOption FrameworkOption = CommonOptions.FrameworkOption(LocalizableStrings.FrameworkOptionDescription);
Expand Down
Loading