Skip to content

[NFR]: Hint for commands that a package provides #19

Description

@niden

Goal: tell the user which package provides an unknown command.

Without phalcon/migrations installed, crest migration:run prints:

unknown command 'migration:run'

The user does not learn that a package provides the command. Proposed:

unknown command 'migration:run'; provided by phalcon/migrations
  • A prefix-to-package map in Crest\Commands, for example migration: to phalcon/migrations. Strings only, no class references, so nothing breaks when a package changes its classes.
  • The console core gets the map from outside, for example as a constructor argument. Crest\Console must not name crest or its packages (IsolationTest). The error comes from Registry (src/Console/Registry.php).
  • Tests: the hint prints for a known prefix, and the plain message stays for every other name.

This needs no change in phalcon/migrations. It does not depend on [NFR]: Package-contributed commands.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

  • Status
    Implemented

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions