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

Add logo support for commands #112

Closed
wants to merge 53 commits into from

Conversation

kodie
Copy link
Contributor

@kodie kodie commented Nov 25, 2024

Just like Application's logo function, Commands can have them now as well in the exact same way.

$app = new \Ahc\Cli\Application('Test App', '0.0.1');
$app->command('cmd')->logo('My ASCII Art');

Fixes #115

README.md Outdated Show resolved Hide resolved
src/Input/Command.php Outdated Show resolved Hide resolved
@adhocore
Copy link
Owner

thanks for the pull. should we also create corresponding issues for all the pulls?

src/Input/Command.php Outdated Show resolved Hide resolved
adhocore
adhocore previously approved these changes Nov 26, 2024
@dimtrovich
Copy link
Contributor

is it necessary to define the logo when executing a command? personally, I think the current implementation is sufficient. leaving the logo when calling the default command seems more normal to me.

@kodie
Copy link
Contributor Author

kodie commented Nov 26, 2024

is it necessary to define the logo when executing a command? personally, I think the current implementation is sufficient. leaving the logo when calling the default command seems more normal to me.

@dimtrovich As I mention in #115, currently, the logo doesn't show up for default commands, only for the built-in __default__ function. So if you set a logo and then use a default command, your logo would not be displayed. Also I like the freedom of being able to use a logo (possibly even unique logo) in any of the help screens (like maybe a different version of the ASCII art in each command if I so wished).

For example the logo showing in the screenshots I posted in #110 would not be possible without this PR as that is my default command I'm running help on.

@adhocore
Copy link
Owner

yea not super necessary but ok to have i guess as long as it doesn't mess up current working behavior or get on the way

btw pull needs rebase again :D

@adhocore
Copy link
Owner

@kodie i think instead of fixing this conflict branch, it is easier to branch off new from the latest main and cherry-pick or hand-pick changes on top

@kodie
Copy link
Contributor Author

kodie commented Nov 26, 2024

@adhocore I'll do that now and submit a new PR.

@kodie kodie closed this Nov 26, 2024
@kodie kodie deleted the kodie/add-command-logo-support branch November 26, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logo command doesn't work if a custom default command is set
3 participants