Skip to content

Commit 2eb59c9

Browse files
committed
commands: hide Git credential helper actions from --help
`get`, `store`, `erase`, and `capability` are entry points used by Git itself over the credential helper protocol. They are not user-facing commands: invoking them by hand requires writing the key=value protocol on standard input, and they have no useful behaviour outside of being called by Git. Listing them in `git-credential-manager --help` is just noise that distracts from the commands a human actually runs (configure, unconfigure, diagnose, and the per-provider subcommands). Set IsHidden = true on each of the four commands. They remain fully invokable (Git's calls are unaffected), they just no longer appear in the top-level help listing. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com> Assisted-by: Claude Opus 4.7
1 parent 7f2ed25 commit 2eb59c9

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/Core/Commands/CapabilityCommand.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public CapabilityCommand(ICommandContext context)
4141
EnsureArgument.NotNull(context, nameof(context));
4242
_context = context;
4343

44+
IsHidden = true;
45+
4446
this.SetHandler(Execute);
4547
}
4648

src/Core/Commands/EraseCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ namespace GitCredentialManager.Commands
88
public class EraseCommand : GitCommandBase
99
{
1010
public EraseCommand(ICommandContext context, IHostProviderRegistry hostProviderRegistry)
11-
: base(context, "erase", "[Git] Erase a stored credential", hostProviderRegistry) { }
11+
: base(context, "erase", "[Git] Erase a stored credential", hostProviderRegistry)
12+
{
13+
IsHidden = true;
14+
}
1215

1316
protected override Task ExecuteInternalAsync(GitRequest request, IHostProvider provider)
1417
{

src/Core/Commands/GetCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ namespace GitCredentialManager.Commands
1111
public class GetCommand : GitCommandBase
1212
{
1313
public GetCommand(ICommandContext context, IHostProviderRegistry hostProviderRegistry)
14-
: base(context, "get", "[Git] Return a stored credential", hostProviderRegistry) { }
14+
: base(context, "get", "[Git] Return a stored credential", hostProviderRegistry)
15+
{
16+
IsHidden = true;
17+
}
1518

1619
protected override async Task ExecuteInternalAsync(GitRequest request, IHostProvider provider)
1720
{

src/Core/Commands/StoreCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ namespace GitCredentialManager.Commands
99
public class StoreCommand : GitCommandBase
1010
{
1111
public StoreCommand(ICommandContext context, IHostProviderRegistry hostProviderRegistry)
12-
: base(context, "store", "[Git] Store a credential", hostProviderRegistry) { }
12+
: base(context, "store", "[Git] Store a credential", hostProviderRegistry)
13+
{
14+
IsHidden = true;
15+
}
1316

1417
protected override Task ExecuteInternalAsync(GitRequest request, IHostProvider provider)
1518
{

0 commit comments

Comments
 (0)