spectre.console icon indicating copy to clipboard operation
spectre.console copied to clipboard

Alias for Branches

Open chrisdanna opened this issue 3 years ago • 6 comments

Would it be possible to add command like configurations, e.g. Alias and Description for branches? I am having an issue where my branch names are becoming fairly long, and would improve ease of use of my CLI if descriptions and aliases for branches were avaialable.

app.Configure(config =>
{
  config.AddBranch<AddSettings>("add", add =>
  {
    add.Alias("a") // <-- or something similar
    add.SetDescription("Add something");
    add.AddCommand<AddPackageCommand>("package");
    add.AddCommand<AddReferenceCommand>("reference");
  })
});

chrisdanna avatar May 12 '21 13:05 chrisdanna

@chrisdanna That sounds like a reasonable thing to add, and I can't see any problems with it. What do you think @phil-scott-78?

patriksvensson avatar May 12 '21 13:05 patriksvensson

Personally I've run into the need once, too. The issue for me was the fact that users might expect or prefer a different name, e.g. add/set instead of insert for branches that "add" multiple different things with a "subcommand" inside the branch.

That being said I wonder if it should be AddAlias(es) and allow multiple aliases. I'm curious how to display the alias(es) in the help text 🤔

bddckr avatar May 12 '21 13:05 bddckr

I see nothing wrong with adding it. It'd be a nice addition 👍

phil-scott-78 avatar May 12 '21 13:05 phil-scott-78

Hello, Can I try to fix this ?

idormenco avatar May 14 '21 08:05 idormenco

@idormenco That would be great! 👍

patriksvensson avatar May 14 '21 08:05 patriksvensson

How's it going @idormenco? 😄

OskarKlintrot avatar Sep 19 '22 09:09 OskarKlintrot

Any news?

AlexSuprunQuali avatar Jan 23 '23 10:01 AlexSuprunQuali

Hi @AlexSuprunQuali , sorry I did not worked on this issue. Please unassign me

idormenco avatar Jan 24 '23 14:01 idormenco

Added PR addressing this issue, check #1131

ilyahryapko avatar Feb 07 '23 18:02 ilyahryapko

All, thanks to @ilyahryapko you can now add an alias to a branch. This functionality has now been merged into main.

FrankRay78 avatar Feb 09 '23 14:02 FrankRay78