-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: add ability for providers to expose custom cmds
Add the ability for host providers to register themselves as offering custom commands, under the provider ID name. For example a provider with the ID 'foo' would be able to expose commands under the `git-credential-manager-core foo <..>` command.
- Loading branch information
1 parent
d058996
commit 5f1c108
Showing
2 changed files
with
33 additions
and
0 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
20 changes: 20 additions & 0 deletions
20
src/shared/Microsoft.Git.CredentialManager/Commands/ProviderCommand.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,20 @@ | ||
using System.CommandLine; | ||
|
||
namespace Microsoft.Git.CredentialManager.Commands | ||
{ | ||
public interface ICommandProvider | ||
{ | ||
/// <summary> | ||
/// Create a custom provider command. | ||
/// </summary> | ||
ProviderCommand CreateCommand(); | ||
} | ||
|
||
public class ProviderCommand : Command | ||
{ | ||
public ProviderCommand(IHostProvider provider) | ||
: base(provider.Id, $"Commands for interacting with the {provider.Name} host provider") | ||
{ | ||
} | ||
} | ||
} |