2017-03-06 11:57:19 -08:00
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
2017-03-09 18:45:11 -08:00
|
|
|
using System.Linq;
|
2017-03-06 11:57:19 -08:00
|
|
|
using Microsoft.DotNet.Cli.CommandLine;
|
2017-03-09 18:45:11 -08:00
|
|
|
using Microsoft.DotNet.Tools.Migrate;
|
|
|
|
using LocalizableStrings = Microsoft.DotNet.Tools.Migrate.LocalizableStrings;
|
2017-03-06 11:57:19 -08:00
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli
|
|
|
|
{
|
|
|
|
internal static class MigrateCommandParser
|
|
|
|
{
|
|
|
|
public static Command Migrate() =>
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Command(
|
|
|
|
"migrate",
|
|
|
|
".NET Migrate Command",
|
2017-03-10 17:52:40 -08:00
|
|
|
Accept.ZeroOrOneArgument()
|
2017-03-19 14:35:11 -07:00
|
|
|
.MaterializeAs(o =>
|
|
|
|
new MigrateCommand(
|
|
|
|
o.ValueOrDefault<string>("--template-file"),
|
|
|
|
o.Arguments.FirstOrDefault(),
|
|
|
|
o.ValueOrDefault<string>("--sdk-package-version"),
|
|
|
|
o.ValueOrDefault<string>("--xproj-file"),
|
|
|
|
o.ValueOrDefault<string>("--report-file"),
|
|
|
|
o.ValueOrDefault<bool>("--skip-project-references"),
|
|
|
|
o.ValueOrDefault<bool>("--format-report-file-json"),
|
|
|
|
o.ValueOrDefault<bool>("--skip-backup")))
|
|
|
|
.With(name: LocalizableStrings.CmdProjectArgument,
|
|
|
|
description: LocalizableStrings.CmdProjectArgumentDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
CommonOptions.HelpOption(),
|
|
|
|
Create.Option("-t|--template-file",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdTemplateDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("-v|--sdk-package-version",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdVersionDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("-x|--xproj-file",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdXprojFileDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("-s|--skip-project-references",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdSkipProjectReferencesDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("-r|--report-file",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdReportFileDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("--format-report-file-json",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdReportOutputDescription),
|
2017-03-09 18:45:11 -08:00
|
|
|
Create.Option("--skip-backup",
|
2017-03-19 14:35:11 -07:00
|
|
|
LocalizableStrings.CmdSkipBackupDescription));
|
2017-03-06 11:57:19 -08:00
|
|
|
}
|
|
|
|
}
|