refactor(git-provider): Centralise *-GitRepo noun name
This commit is contained in:
parent
740d35d3e7
commit
48ad65e86c
5 changed files with 11 additions and 12 deletions
|
|
@ -3,11 +3,9 @@ using ModuleCore.Git;
|
||||||
|
|
||||||
namespace PowershellModule.Git.Commands;
|
namespace PowershellModule.Git.Commands;
|
||||||
|
|
||||||
[Cmdlet(VerbsCommon.Get, Noun)]
|
[Cmdlet(VerbsCommon.Get, GitCommands.GitRepoNoun)]
|
||||||
public class ListGitRepoCommand : PSCmdlet
|
public class ListGitRepoCommand : PSCmdlet
|
||||||
{
|
{
|
||||||
private const string Noun = "GitRepo";
|
|
||||||
|
|
||||||
protected override void BeginProcessing()
|
protected override void BeginProcessing()
|
||||||
{
|
{
|
||||||
var repos = GitManager.Instance.ListRepos();
|
var repos = GitManager.Instance.ListRepos();
|
||||||
|
|
|
||||||
6
src/PowershellModule/Git/Commands/GitCommands.cs
Normal file
6
src/PowershellModule/Git/Commands/GitCommands.cs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace PowershellModule.Git.Commands;
|
||||||
|
|
||||||
|
public class GitCommands
|
||||||
|
{
|
||||||
|
public const string GitRepoNoun = "GitRepo";
|
||||||
|
}
|
||||||
|
|
@ -6,11 +6,9 @@ using ModuleCore.Git;
|
||||||
|
|
||||||
namespace PowershellModule.Git.Commands;
|
namespace PowershellModule.Git.Commands;
|
||||||
|
|
||||||
[Cmdlet(VerbsCommon.New, Noun)]
|
[Cmdlet(VerbsCommon.New, GitCommands.GitRepoNoun)]
|
||||||
public sealed class NewGitRepoCommand : PSCmdlet
|
public sealed class NewGitRepoCommand : PSCmdlet
|
||||||
{
|
{
|
||||||
private const string Noun = "GitRepo";
|
|
||||||
|
|
||||||
[Parameter(
|
[Parameter(
|
||||||
Position = 0,
|
Position = 0,
|
||||||
ValueFromPipeline = true,
|
ValueFromPipeline = true,
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,10 @@ using ModuleCore.Git;
|
||||||
|
|
||||||
namespace PowershellModule.Git.Commands;
|
namespace PowershellModule.Git.Commands;
|
||||||
|
|
||||||
[Cmdlet(VerbsCommon.Set, Noun)]
|
// TODO: decide if I want to use this verb instead of show. Currently this implementation is under Show-GitRepo
|
||||||
|
[Cmdlet(VerbsCommon.Set, GitCommands.GitRepoNoun)]
|
||||||
public class SetGitRepoCommand : PSCmdlet
|
public class SetGitRepoCommand : PSCmdlet
|
||||||
{
|
{
|
||||||
private const string Noun = "GitRepo";
|
|
||||||
|
|
||||||
public SetGitRepoCommand()
|
public SetGitRepoCommand()
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{nameof(NewGitRepoCommand)} init");
|
Console.WriteLine($"{nameof(NewGitRepoCommand)} init");
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,9 @@ using ModuleCore.Git;
|
||||||
|
|
||||||
namespace PowershellModule.Git.Commands;
|
namespace PowershellModule.Git.Commands;
|
||||||
|
|
||||||
[Cmdlet(VerbsCommon.Show, Noun)]
|
[Cmdlet(VerbsCommon.Show, GitCommands.GitRepoNoun)]
|
||||||
public class ShowGitRepoCommand : PSCmdlet
|
public class ShowGitRepoCommand : PSCmdlet
|
||||||
{
|
{
|
||||||
private const string Noun = "GitRepo";
|
|
||||||
|
|
||||||
[Parameter(
|
[Parameter(
|
||||||
Position = 0,
|
Position = 0,
|
||||||
ValueFromPipeline = true,
|
ValueFromPipeline = true,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue