Skip to content

Command namespaces #7

Description

@AaronMcHale

I don't have any specific need for this just now, but namespaces for commands could be a useful way of grouping commands if there are a lot.

I'm imagining something like this:

  1. A namespace is defined as a sub-directory of the commands directory.
  2. Any scripts within the sub-directory have their commands automatically prefixed with the name of the namespace. For instance, if we moved the hello-world script into a examples sub-directory, then the hello-world command would become examples:hello-world.
  3. The command list could then show commands grouped by their namespaces, with any scripts in the top-level commands directory being shown without a namespace.
  4. Existing scripts in the top-level commands directory would remain unchanged and would work as they do now.
  5. If we do add command aliases, see Support for command aliases #6, aliases would not be namespaced, so in the above example, if the examples:hello-world command had the alias hello, you could run the command hello or examples:hello-world.

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