Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
rename 'list-sources' to 'feeds list'
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay committed Jun 29, 2015
1 parent 23fd143 commit b6124c1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@

namespace Microsoft.Framework.PackageManager
{
internal static class ListSourcesConsoleCommand
internal static class FeedsConsoleCommand
{
public static void Register(CommandLineApplication cmdApp, ReportsFactory reportsFactory)
{
cmdApp.Command("list-sources", c =>
cmdApp.Command("feeds", c =>
{
c.Description = "Displays a list of package sources in effect for a project";
c.Description = "Commands related to managing package feeds currently in use";
c.HelpOption("-?|-h|--help");
c.OnExecute(() =>
{
c.ShowHelp();
return 2;
});
RegisterListCommand(c, reportsFactory);
});
}

public static void RegisterListCommand(CommandLineApplication cmdApp, ReportsFactory reportsFactory)
{
cmdApp.Command("list", c =>
{
c.Description = "Displays a list of package sources in effect for a project";
var argRoot = c.Argument("[root]",
"The path of the project to calculate effective package sources for (defaults to the current directory)");
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Framework.PackageManager/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public int Main(string[] args)
PublishConsoleCommand.Register(app, reportsFactory, _environment, _hostServices);
RestoreConsoleCommand.Register(app, reportsFactory, _environment);
WrapConsoleCommand.Register(app, reportsFactory);
ListSourcesConsoleCommand.Register(app, reportsFactory);
FeedsConsoleCommand.Register(app, reportsFactory);

return app.Execute(args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public int Execute()

// Iterate over the sources and report them
int index = 1; // This is an index for display so it should be 1-based
foreach(var source in sources)
foreach (var source in sources)
{
var enabledString = source.IsEnabled ? "" : " [Disabled]";
var line = $"{index.ToString("0\\.").PadRight(3)} {source.Name} {source.Source}{enabledString.Yellow().Bold()}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
namespace Microsoft.Framework.PackageManager
{
[Collection(nameof(PackageManagerFunctionalTestCollection))]
public class DnuSourcesTests
public class DnuFeedsTests
{
private readonly PackageManagerFunctionalTestFixture _fixture;

public DnuSourcesTests(PackageManagerFunctionalTestFixture fixture)
public DnuFeedsTests(PackageManagerFunctionalTestFixture fixture)
{
_fixture = fixture;
}
Expand All @@ -29,7 +29,7 @@ public static IEnumerable<object[]> RuntimeComponents

[Theory]
[MemberData(nameof(RuntimeComponents))]
public void DnuSources_NoSources(string flavor, string os, string architecture)
public void DnuFeeds_NoSources(string flavor, string os, string architecture)
{
var environment = new Dictionary<string, string>
{
Expand Down Expand Up @@ -66,8 +66,8 @@ public void DnuSources_NoSources(string flavor, string os, string architecture)
string error;
var exitCode = DnuTestUtils.ExecDnu(
runtimeHomePath,
subcommand: "list-sources",
arguments: "root",
subcommand: "feeds",
arguments: "list root",
stdOut: out output,
stdErr: out error,
environment: environment,
Expand All @@ -81,7 +81,7 @@ public void DnuSources_NoSources(string flavor, string os, string architecture)

[Theory]
[MemberData(nameof(RuntimeComponents))]
public void DnuSources_ListsAllSources(string flavor, string os, string architecture)
public void DnuFeeds_ListsAllSources(string flavor, string os, string architecture)
{
var environment = new Dictionary<string, string>
{
Expand Down Expand Up @@ -138,8 +138,8 @@ public void DnuSources_ListsAllSources(string flavor, string os, string architec
string error;
var exitCode = DnuTestUtils.ExecDnu(
runtimeHomePath,
subcommand: "list-sources",
arguments: "root/sub",
subcommand: "feeds",
arguments: "list root/sub",
stdOut: out output,
stdErr: out error,
environment: environment,
Expand Down

0 comments on commit b6124c1

Please sign in to comment.