Skip to content

Add logo support for commands#112

Closed
kodie wants to merge 53 commits into
adhocore:mainfrom
kodie:kodie/add-command-logo-support
Closed

Add logo support for commands#112
kodie wants to merge 53 commits into
adhocore:mainfrom
kodie:kodie/add-command-logo-support

Conversation

@kodie

@kodie kodie commented Nov 25, 2024

Copy link
Copy Markdown
Contributor

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

Comment thread README.md Outdated
Comment thread src/Input/Command.php Outdated
@adhocore

Copy link
Copy Markdown
Owner

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

Comment thread src/Input/Command.php Outdated
adhocore
adhocore previously approved these changes Nov 26, 2024
@dimtrovich

Copy link
Copy Markdown
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

kodie commented Nov 26, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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
Copy Markdown
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

kodie commented Nov 26, 2024

Copy link
Copy Markdown
Contributor Author

@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