Skip to content

Commit

Permalink
(cake-buildGH-3007) Support same CLI switches for script runners and …
Browse files Browse the repository at this point in the history
…Frosting
  • Loading branch information
pascalberger committed Dec 21, 2020
1 parent 9e2b1e5 commit f4b0559
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/Cake.Frosting/Internal/Commands/DefaultCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private IFrostingEngine GetFrostingEngine(ServiceProvider provider, DefaultComma
{
return provider.GetRequiredService<FrostingTreeRunner>();
}
else if (settings.Descriptions)
else if (settings.Description)
{
return provider.GetRequiredService<FrostingDescriptionRunner>();
}
Expand Down
26 changes: 13 additions & 13 deletions src/Cake.Frosting/Internal/Commands/DefaultCommandSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ internal sealed class DefaultCommandSettings : CommandSettings
[Description("Target task to invoke.")]
public string Target { get; set; }

[CommandOption("-e|--exclusive")]
[Description("Executes the target task without any dependencies.")]
public bool Exclusive { get; set; }

[CommandOption("--working|-w <PATH>")]
[TypeConverter(typeof(DirectoryPathConverter))]
[Description("Sets the working directory")]
public DirectoryPath WorkingDirectory { get; set; }

[CommandOption("--verbosity|-v <VERBOSITY>")]
[Description("Specifies the amount of information to be displayed.\n(Quiet, Minimal, Normal, Verbose, Diagnostic)")]
[TypeConverter(typeof(VerbosityConverter))]
[DefaultValue(Verbosity.Normal)]
[Description("Specifies the amount of information to be displayed.\n(Quiet, Minimal, Normal, Verbose, Diagnostic)")]
public Verbosity Verbosity { get; set; }

[CommandOption("--dryrun|--noop|--whatif")]
[Description("Performs a dry run.")]
public bool DryRun { get; set; }
[CommandOption("--description|--descriptions|--showdescription|--showdescriptions")]
[Description("Shows description for each task.")]
public bool Description { get; set; }

[CommandOption("--tree")]
[CommandOption("--tree|--showtree")]
[Description("Shows the task dependency tree.")]
public bool Tree { get; set; }

[CommandOption("--descriptions")]
[Description("Shows task descriptions.")]
public bool Descriptions { get; set; }
[CommandOption("--dryrun|--noop|--whatif")]
[Description("Performs a dry run.")]
public bool DryRun { get; set; }

[CommandOption("--exclusive|-e")]
[Description("Executes the target task without any dependencies.")]
public bool Exclusive { get; set; }

[CommandOption("--version")]
[CommandOption("--version|--ver")]
[Description("Displays version information.")]
public bool Version { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/Cake/Commands/DefaultCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ private BuildHostKind GetBuildHostKind(DefaultCommandSettings settings)
{
return BuildHostKind.DryRun;
}
else if (settings.ShowDescription)
else if (settings.Description)
{
return BuildHostKind.Description;
}
else if (settings.ShowTree)
else if (settings.Tree)
{
return BuildHostKind.Tree;
}
Expand Down
44 changes: 22 additions & 22 deletions src/Cake/Commands/DefaultCommandSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,6 @@ public sealed class DefaultCommandSettings : CommandSettings
[DefaultValue("build.cake")]
public FilePath Script { get; set; }

[CommandOption("-v|--verbosity")]
[Description("Specifies the amount of information to be displayed.")]
[TypeConverter(typeof(VerbosityConverter))]
[DefaultValue(Verbosity.Normal)]
public Verbosity Verbosity { get; set; }

[CommandOption("-d|--debug")]
[Description("Launches script in debug mode.")]
public bool Debug { get; set; }

[CommandOption("-e|--exclusive")]
[Description("Executes the target task without any dependencies.")]
public bool Exclusive { get; set; }

[CommandOption("--dryrun|--noop|--whatif")]
[Description("Performs a dry run.")]
public bool DryRun { get; set; }

[CommandOption("--bootstrap")]
[Description("Download/install modules defined by [grey]#module[/] directives, but do not run build.")]
public bool Bootstrap { get; set; }
Expand All @@ -44,13 +26,31 @@ public sealed class DefaultCommandSettings : CommandSettings
[Description("Skips bootstrapping when running build.")]
public bool SkipBootstrap { get; set; }

[CommandOption("--description|--showdescription")]
[Description("Shows task descriptions.")]
public bool ShowDescription { get; set; }
[CommandOption("--debug|-d")]
[Description("Launches script in debug mode.")]
public bool Debug { get; set; }

[CommandOption("--verbosity|-v <VERBOSITY>")]
[Description("Specifies the amount of information to be displayed.\n(Quiet, Minimal, Normal, Verbose, Diagnostic)")]
[TypeConverter(typeof(VerbosityConverter))]
[DefaultValue(Verbosity.Normal)]
public Verbosity Verbosity { get; set; }

[CommandOption("--description|--descriptions|--showdescription|--showdescriptions")]
[Description("Shows description for each task.")]
public bool Description { get; set; }

[CommandOption("--tree|--showtree")]
[Description("Shows the task dependency tree.")]
public bool ShowTree { get; set; }
public bool Tree { get; set; }

[CommandOption("--dryrun|--noop|--whatif")]
[Description("Performs a dry run.")]
public bool DryRun { get; set; }

[CommandOption("--exclusive|-e")]
[Description("Executes the target task without any dependencies.")]
public bool Exclusive { get; set; }

[CommandOption("--version|--ver")]
[Description("Displays version information.")]
Expand Down

0 comments on commit f4b0559

Please sign in to comment.