-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fixes dotnet/templating #3807 update subcommand
- Loading branch information
1 parent
56531f0
commit c285a2e
Showing
25 changed files
with
611 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/Microsoft.TemplateEngine.Cli/Commands/SharedOptionsFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.CommandLine; | ||
|
||
namespace Microsoft.TemplateEngine.Cli.Commands | ||
{ | ||
internal static class SharedOptionsFactory | ||
{ | ||
internal static Option<bool> GetInteractiveOption() | ||
{ | ||
return new Option<bool>("--interactive") | ||
{ | ||
Description = LocalizableStrings.OptionDescriptionInteractive | ||
}; | ||
} | ||
|
||
internal static Option<IReadOnlyList<string>> GetAddSourceOption() | ||
{ | ||
return new(new[] { "--add-source", "--nuget-source" }) | ||
{ | ||
Description = LocalizableStrings.OptionDescriptionNuGetSource, | ||
AllowMultipleArgumentsPerToken = true, | ||
}; | ||
} | ||
|
||
internal static Option<T> AsHidden<T>(this Option<T> o) | ||
{ | ||
o.IsHidden = true; | ||
return o; | ||
} | ||
|
||
internal static Option<T> DisableAllowMultipleArgumentsPerToken<T>(this Option<T> o) | ||
{ | ||
o.AllowMultipleArgumentsPerToken = false; | ||
return o; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 27 additions & 18 deletions
45
src/Microsoft.TemplateEngine.Cli/LocalizableStrings.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.