Skip to content

Support for command aliases #6

Description

@AaronMcHale

We may want to provide support for creating aliases for commands. For example we could alias the hello-world example command to hw or hello.

One way to approach this could be:

  1. Commands defining a .alias.txt file, which contains their aliases.
  2. In cli.sh as we loop through each command, we check if there is a .alias.txt file, and store the aliases from that file.
  3. We could structure cli.sh so that as it's looping through all of the commands, the aliases are also added to the commands array, and for the command list a separate array which just has the commands but contains the aliases and help text.
  4. The aliases are shown with the help text in the command list, so for hello-world, the text could be [hw, hello] Example hello world command. the aliases are shown in the square brackets.

What I'm not sure about: What do we do if there's a conflict between an alias and an existing command, should the alias override the command, or should the command override the alias?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions