refactor(git-provider): Centralise *-GitRepo noun name

This commit is contained in:
Scott 2026-08-23 09:58:16 +10:00
commit 48ad65e86c
5 changed files with 11 additions and 12 deletions

View file

@ -3,11 +3,9 @@ using ModuleCore.Git;
namespace PowershellModule.Git.Commands;
[Cmdlet(VerbsCommon.Get, Noun)]
[Cmdlet(VerbsCommon.Get, GitCommands.GitRepoNoun)]
public class ListGitRepoCommand : PSCmdlet
{
private const string Noun = "GitRepo";
protected override void BeginProcessing()
{
var repos = GitManager.Instance.ListRepos();

View file

@ -0,0 +1,6 @@
namespace PowershellModule.Git.Commands;
public class GitCommands
{
public const string GitRepoNoun = "GitRepo";
}

View file

@ -6,11 +6,9 @@ using ModuleCore.Git;
namespace PowershellModule.Git.Commands;
[Cmdlet(VerbsCommon.New, Noun)]
[Cmdlet(VerbsCommon.New, GitCommands.GitRepoNoun)]
public sealed class NewGitRepoCommand : PSCmdlet
{
private const string Noun = "GitRepo";
[Parameter(
Position = 0,
ValueFromPipeline = true,

View file

@ -4,11 +4,10 @@ using ModuleCore.Git;
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
{
private const string Noun = "GitRepo";
public SetGitRepoCommand()
{
Console.WriteLine($"{nameof(NewGitRepoCommand)} init");

View file

@ -4,11 +4,9 @@ using ModuleCore.Git;
namespace PowershellModule.Git.Commands;
[Cmdlet(VerbsCommon.Show, Noun)]
[Cmdlet(VerbsCommon.Show, GitCommands.GitRepoNoun)]
public class ShowGitRepoCommand : PSCmdlet
{
private const string Noun = "GitRepo";
[Parameter(
Position = 0,
ValueFromPipeline = true,