Skip to content

Automatically find the name of the core bin file, instead of hardcoding #109

Description

@hopeseekr

The Annoyance

Every time I create a new minicli app, I need to edit every mention of minicli to whatever the binary is.

If I want to rename the bin file, I have to edit every single mention of it in the app.

The Solution

  1. Add a public readonly string $me to App so now you can call $app->me to get the filename.
  2. Add a protected function findBinFileName(): string that will automagically find the filename.
  3. Call this from within the App::__construct().

This way, the end-developer can easily do things like echo "{$app->me} commad";. You can't embed method calls into strings like that.

And the developer will never need to automate anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions