mirror of https://github.com/dotnet/tye.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.6 KiB
46 lines
1.6 KiB
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System.Collections.Generic;
|
|
using System.CommandLine;
|
|
using System.CommandLine.Invocation;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Tye.ConfigModel;
|
|
|
|
namespace Microsoft.Tye
|
|
{
|
|
static partial class Program
|
|
{
|
|
public static Command CreateGenerateCommand()
|
|
{
|
|
var command = new Command("generate", "generate kubernetes manifests")
|
|
{
|
|
CommonArguments.Path_Required,
|
|
StandardOptions.Interactive,
|
|
StandardOptions.Verbosity,
|
|
StandardOptions.Namespace,
|
|
StandardOptions.Tags
|
|
};
|
|
|
|
// This is a super-secret VIP-only command! It's useful for testing, but we're
|
|
// not documenting it right now.
|
|
command.IsHidden = true;
|
|
|
|
command.Handler = CommandHandler.Create<IConsole, FileInfo, Verbosity, bool, string, string[]>((console, path, verbosity, interactive, @namespace, tags) =>
|
|
{
|
|
// Workaround for https://github.com/dotnet/command-line-api/issues/723#issuecomment-593062654
|
|
if (path is null)
|
|
{
|
|
throw new CommandException("No project or solution file was found.");
|
|
}
|
|
|
|
return GenerateHost.GenerateAsync(console, path, verbosity, interactive, @namespace, tags);
|
|
});
|
|
|
|
return command;
|
|
}
|
|
}
|
|
}
|
|
|