Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command aliases do not show in the help display #662

Open
dlandi opened this issue Dec 10, 2021 · 5 comments
Open

Command aliases do not show in the help display #662

dlandi opened this issue Dec 10, 2021 · 5 comments
Labels
area-CLI Command-Line Interface bug Something isn't working ⭐ top bug Top bug.

Comments

@dlandi
Copy link

dlandi commented Dec 10, 2021

Example:
config.AddCommand("install-cloud")
.WithAlias("cloud").WithAlias("cld");
//config.AddCommand("cloud");
//config.AddCommand("cld");

If you use config.AddCommand(), each command shows up in help display, but the WithAlias() option does not.


Please upvote 👍 this issue if you are interested in it.

@dlandi dlandi added the bug Something isn't working label Dec 10, 2021
@nils-a nils-a changed the title AddAlias() doesn Command aliases do not show in the help display Dec 10, 2021
@nils-a
Copy link
Contributor

nils-a commented Dec 10, 2021

@dlandi thanks for reporting this.
Do you have any idea on what the help display should look like, if aliases were reported?

@dlandi
Copy link
Author

dlandi commented Dec 10, 2021

Sure. Given:

      config.AddCommand<InstallCloudCommand>("install-cloud")
      .WithDescription("Install Cloud API from Zip File")
      .WithAlias("cloud").WithAlias("cld");
      
      config.AddCommand<InitializeAccountCommand>("init-account")
      .WithDescription("Initialize Account DB from Powershell Script File")
       WithAlias("account").WithAlias("adb"); 
      
       config.AddCommand<InitializeCloudDb>("init-cloud-db")
      .WithDescription("Initialize Cloud Database from Powershell Script File")
      .WithAlias("cloud-db").WithAlias("cdb");

Output would be :

Command          Alias[es]		Description
-------------------------------------------------------------------------------
install-cloud          [cloud|cld]               Install Cloud API from Zip File
init-account          [account|adb]          Initialize Account DB from Powershell Script File
init-cloud-db        [cloud-db|cdb]        Initialize Cloud Database from Powershell Script File

@nils-a
Copy link
Contributor

nils-a commented Dec 11, 2021

Since the commands' section does not have headers, this would look like:

COMMANDS:
    dog <AGE>           some-dog, a-dog        The dog command
    giraffe <LENGTH>                           The giraffe command
    horse               some-horse, a-horse    The horse command

or

COMMANDS:
    dog <AGE>           [some-dog|a-dog]        The dog command
    giraffe <LENGTH>                            The giraffe command
    horse               [some-horse|a-horse]    The horse command

I feel adding a cell "aliases" to the commands' section would take away too much space (which is sometimes very limited in CLI).

What about adding it to the description?
Something like:

COMMANDS:
    dog <AGE>           The dog command
                        Aliases: some-dog, a-dog
    giraffe <LENGTH>    The giraffe command
    horse               The horse command
                        Aliases: some-hosre, a-horse

@patriksvensson, @phil-scott-78: Any ideas or opinions?

@BatanGaming
Copy link

Hi there. I'd like to do it. What do you think about this layout?

COMMANDS:
    build-something        [build|b]    Builds something 
    no-alias                            Some description 
    create                 [c]          Creates something

@FrankRay78 FrankRay78 added the area-CLI Command-Line Interface label May 13, 2023
@Psychlist1972
Copy link

Psychlist1972 commented Jan 5, 2024

What about adding it to the description? Something like:

COMMANDS:
    dog <AGE>           The dog command
                        Aliases: some-dog, a-dog
    giraffe <LENGTH>    The giraffe command
    horse               The horse command
                        Aliases: some-hosre, a-horse

@patriksvensson, @phil-scott-78: Any ideas or opinions?

Did anything happen with this? I like the approach of putting the aliases under the description, as that makes the best use of space, IMO.

Pete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CLI Command-Line Interface bug Something isn't working ⭐ top bug Top bug.
Projects
Status: Todo 🕑
Development

No branches or pull requests

5 participants