add dotnet list p2ps (#4929)

* add stub for dotnet list p2ps

* apply review feedback

* PR feedback: consistent method modifiers

* apply missed review feedback

* add test coverage and do not treat no p2ps as error

* move private methods to the bottom, rename weird res name
This commit is contained in:
Krzysztof Wicher 2016-12-07 12:56:27 -08:00 committed by Piotr Puszkiewicz
commit 79e6126b2a
17 changed files with 448 additions and 3 deletions

View file

@ -0,0 +1,40 @@
// 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.
using System;
using System.Collections.Generic;
using Microsoft.DotNet.Tools.List.ProjectToProjectReferences;
namespace Microsoft.DotNet.Tools.List
{
public class ListCommand : DispatchCommand
{
protected override string HelpText => $@"{LocalizableStrings.ListCommandDescription}
{LocalizableStrings.Usage}: dotnet list [options] <object> <command> [[--] <arg>...]]
Options:
-h|--help {LocalizableStrings.HelpDefinition}
{LocalizableStrings.Arguments}:
<object> {LocalizableStrings.ObjectDefinition}
<command> {LocalizableStrings.CommandDefinition}
{LocalizableStrings.ExtraArgs}:
{LocalizableStrings.ExtraArgumentsDefinition}
{LocalizableStrings.Commands}:
p2ps {LocalizableStrings.P2PsDefinition}";
protected override Dictionary<string, Func<string[], int>> BuiltInCommands => new Dictionary<string, Func<string[], int>>
{
["p2ps"] = ListProjectToProjectReferencesCommand.Run,
};
public static int Run(string[] args)
{
var cmd = new ListCommand();
return cmd.Start(args);
}
}
}