Skip to content

Commit

Permalink
Bundles: Allow argument separator (--)
Browse files Browse the repository at this point in the history
Fixes #26945
  • Loading branch information
bricelam committed Jan 6, 2022
1 parent 13bb9b0 commit 003eb01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/EFCore.Design/Migrations/Design/MigrationsBundle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ public static int Execute(string? context, Assembly assembly, Assembly startupAs
_assembly = assembly;
_startupAssembly = startupAssembly;

var app = new CommandLineApplication
{
Name = "bundle",
HandleResponseFiles = true
};
var app = new CommandLineApplication { Name = "efbundle" };

Configure(app);

try
Expand Down Expand Up @@ -73,6 +70,7 @@ public static int Execute(string? context, Assembly assembly, Assembly startupAs
internal static void Configure(CommandLineApplication app)
{
app.FullName = DesignStrings.BundleFullName;
app.AllowArgumentSeparator = true;

_migration = app.Argument("<MIGRATION>", DesignStrings.MigrationDescription);
_connection = app.Option("--connection <CONNECTION>", DesignStrings.ConnectionDescription);
Expand All @@ -83,6 +81,8 @@ internal static void Configure(CommandLineApplication app)
var noColor = app.Option("--no-color", DesignStrings.NoColorDescription);
var prefixOutput = app.Option("--prefix-output", DesignStrings.PrefixDescription);

app.HandleResponseFiles = true;

app.OnExecute(
args =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,27 @@ public void Long_names_are_unique()
}
}

[Fact]
public void HandleResponseFiles_is_true()
{
var app = new CommandLineApplication { Name = "efbundle" };
MigrationsBundle.Configure(app);

Assert.True(app.HandleResponseFiles);
}

[Fact]
public void AllowArgumentSeparator_is_true()
{
var app = new CommandLineApplication { Name = "efbundle" };
MigrationsBundle.Configure(app);

Assert.True(app.AllowArgumentSeparator);
}

private static IEnumerable<CommandLineApplication> GetCommands()
{
var app = new CommandLineApplication { Name = "bundle" };
var app = new CommandLineApplication { Name = "efbundle" };

MigrationsBundle.Configure(app);

Expand Down

0 comments on commit 003eb01

Please sign in to comment.