-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4183e0
commit 04610cf
Showing
9 changed files
with
288 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace Spectre.Console.Cli; | ||
|
||
/// <summary> | ||
/// Represents a branch configurator. | ||
/// </summary> | ||
public interface IBranchConfigurator | ||
{ | ||
/// <summary> | ||
/// Adds an alias (an alternative name) to the branch being configured. | ||
/// </summary> | ||
/// <param name="name">The alias to add to the branch being configured.</param> | ||
/// <returns>The same <see cref="IBranchConfigurator"/> instance so that multiple calls can be chained.</returns> | ||
IBranchConfigurator WithAlias(string name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/Spectre.Console.Cli/Internal/Configuration/BranchConfigurator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Spectre.Console.Cli; | ||
|
||
internal sealed class BranchConfigurator : IBranchConfigurator | ||
{ | ||
public ConfiguredCommand Command { get; } | ||
|
||
public BranchConfigurator(ConfiguredCommand command) | ||
{ | ||
Command = command; | ||
} | ||
|
||
public IBranchConfigurator WithAlias(string alias) | ||
{ | ||
Command.Aliases.Add(alias); | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.