Skip to content

Support for command aliases #13

Description

@jigarius

Requirements

Allow Phpake callbacks to declare command aliases using a @alias annotation. For example,

# Phpakefile

namespace Input_Output;

/**
 * Say hello world.
 *
 * @alias hhum
 * @alias helo
 */
function hello_human() {
  echo 'Hello human' . PHP_EOL;
}

At the end of all the changes, running phpake input-output:hello-human --help should show the command alias(es) correctly. Running phpake helo should work the same way as phpake input-output::hello-human.

Activity

  1. jigarius commented on Oct 9, 2021

    @jigarius
    OwnerAuthor

    Hi Pankaj. This is a good task to start with.

    Next steps

    • Understand what Phpake is (read documentation).
    • Read about Symfony Console - what it is and what it does
    • Use the instructions in the README to setup a local dev env
    • Check how the @usage annotation is being handled by Phpake
      • See class \Phpake\Task
      • See class \Phpake\Commands\ExecCommand
    • Add 2 aliases to the callback hello_human(). I'm not sure if multiple aliases are allowed, so check this in the Symfony Console documentation.
      • hhum
      • helo
    • Modify the code to detect those @alias tags
    • Update the tests

    Let me know if you have any questions and feel free to document things that you think are relevant.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions