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

Implement help command #9

Open
SunflowerFuchs opened this issue Apr 7, 2022 · 1 comment
Open

Implement help command #9

SunflowerFuchs opened this issue Apr 7, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@SunflowerFuchs
Copy link
Owner

We need a help command.
It should probably look like this:

help [function]

Without a parameter, it lists all (currently available) commands.
With a parameter, it returns extended information for the given command, if available.

@SunflowerFuchs SunflowerFuchs added this to the 1.0 milestone Apr 7, 2022
@SunflowerFuchs SunflowerFuchs added the enhancement New feature or request label Apr 7, 2022
@SunflowerFuchs SunflowerFuchs self-assigned this Apr 7, 2022
@SunflowerFuchs
Copy link
Owner Author

First idea in terms of implementation right now:

  • BasePlugin receives the following 3 functions:
    • public function canUseFunction(User $user, string $function) : bool {}
    • public function getHelpTexts() : string[] {}
      • Returns an array of strings, in the form of ['functionName' => 'This is the short help text']
    • public function getExtendedHelpText(string $function) : string {}
      • Returns a more detailed descriptions of the given function
      • If not implemented, falls back to the text from getHelpTexts for that function

Possible problems with this approach:

  • Doesn't allow help texts for plugins without commands
  • Not sure if getHelpTexts should instead just be a property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant