Skip to content

Commit 8d75293

Browse files
Chaseshakethanis
andauthored
Add list-features, --enable-features, & --disable-features (#93)
* Add list-features, --enable-features, & --disable-features * Update command description to include full name (GitHub Actions Importer) Co-authored-by: Ethan Dennis <ethanis@github.com> * Fix typo in enable features option --------- Co-authored-by: Ethan Dennis <ethanis@github.com>
1 parent 90515cb commit 8d75293

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

src/ActionsImporter/Commands/Common.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,25 @@ public static Command AppendTransformerOptions(this Command command)
6363
command.AddGlobalOption(
6464
new Option<string>(new[] { "--features" })
6565
{
66-
Description = "Features to enable in transformed workflows."
66+
Description = "GHES features to enable in transformed workflows."
67+
}
68+
);
69+
70+
command.AddGlobalOption(
71+
new Option<string[]>(new[] { "--enable-features" })
72+
{
73+
Description = "A list of features to enable by name. Use `gh actions-importer list-features` to see available features.",
74+
IsRequired = false,
75+
AllowMultipleArgumentsPerToken = true
76+
}
77+
);
78+
79+
command.AddGlobalOption(
80+
new Option<string[]>(new[] { "--disable-features" })
81+
{
82+
Description = "A list of features to disable by name. Use `gh actions-importer list-features` to see available features.",
83+
IsRequired = false,
84+
AllowMultipleArgumentsPerToken = true
6785
}
6886
);
6987

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.Collections.Immutable;
2+
using System.CommandLine;
3+
4+
namespace ActionsImporter.Commands;
5+
6+
public class ListFeatures : ContainerCommand
7+
{
8+
public ListFeatures(string[] args) : base(args)
9+
{
10+
}
11+
12+
protected override string Name => "list-features";
13+
protected override string Description => "List the available feature flags for GitHub Actions Importer.";
14+
15+
protected override ImmutableArray<Option> Options => ImmutableArray.Create<Option>();
16+
}

src/ActionsImporter/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
new Audit(args).Command(app),
2929
new Forecast(args).Command(app),
3030
new DryRun(args).Command(app),
31-
new Migrate(args).Command(app)
31+
new Migrate(args).Command(app),
32+
new ListFeatures(args).Command(app)
3233
};
3334

3435
var parser = new CommandLineBuilder(command)

0 commit comments

Comments
 (0)