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
[#7] Better help command output #30
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,25 +37,79 @@ | |
Application::class => \DI\factory(function (ContainerInterface $c) { | ||
$application = new \PhpSchool\WorkshopManager\Application('PHP School workshop manager', '1.1.0', $c); | ||
$application->command('install workshopName', InstallWorkshop::class, ['add']) | ||
->setDescription('Install a PHP School workshop.'); | ||
->setDescription('Install a PHP School workshop.') | ||
->setHelp(<<<'EOF' | ||
This command requires a <comment>workshopName</comment> code as argument: | ||
<info>workshop-manager <comment>workshopName</comment></info> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is missing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it was, my bad. |
||
Install a workshop with its package field, you can find this by doing a search like: | ||
<info>workshop-manager search php</info> | ||
In this example you would just use <comment>learnyouphp</comment> as workshopName. | ||
<info>workshop-manager install <comment>learnyouphp</comment></info> | ||
You can then get started on your <comment>workshop</comment> instantly by using its package name. | ||
EOF | ||
); | ||
$application->command('uninstall workshopName', UninstallWorkshop::class, ['remove', 'delete']) | ||
->setDescription('Uninstall a PHP School workshop.'); | ||
->setDescription('Uninstall a PHP School workshop.') | ||
->setHelp(<<<'EOF' | ||
This command requires a <comment>workshopName</comment> code as argument: | ||
<info>workshop-manager %command.name% <comment>workshopName</comment></info> | ||
Remove a workshop by its package name (Example using <comment>learnyouphp</comment> as workshopName). | ||
<info>workshop-manager %command.name% <comment>learnyouphp</comment></info> | ||
EOF | ||
); | ||
$application->command('update workshopName', UpdateWorkshop::class) | ||
->setDescription('update a PHP School workshop.'); | ||
->setDescription('update a PHP School workshop.') | ||
->setHelp(<<<'EOF' | ||
This command requires a <comment>workshopName</comment> code as argument: | ||
<info>workshop-manager %command.name% <comment>workshopName</comment></info> | ||
To update a workshop you already have installed (Example using <comment>learnyouphp</comment> as workshopName). | ||
<info>workshop-manager %command.name% <comment>learnyouphp</comment></info> | ||
EOF | ||
); | ||
$application->command('search [workshopName]', SearchWorkshops::class, ['find']) | ||
->setDescription('Search for a PHP School workshop.'); | ||
->setDescription('Search for a PHP School workshop.') | ||
->setHelp(<<<'EOF' | ||
This command requires part of workshop name as argument: | ||
<info>workshop-manager %command.name% <comment>workshopName</comment></info> | ||
Quickly find available workshops by part of its name and get an instant indication if they're already installed. | ||
<info>workshop-manager %command.name% <comment>php</comment></info> | ||
EOF | ||
); | ||
$application->command('installed', ListWorkshops::class, ['show']) | ||
->setDescription('List installed PHP School workshops.'); | ||
->setDescription('List installed PHP School workshops.') | ||
->setHelp(<<<'EOF' | ||
List the installed workshops, just so you know what you can get working on. | ||
<info>workshop-manager <comment>%command.name%</comment></info> | ||
It will also let you know if you need to update any workshops that you already have installed. | ||
EOF | ||
); | ||
|
||
if (extension_loaded('phar') && Phar::running()) { | ||
$application->command('self-update', SelfUpdate::class) | ||
->setDescription('Update the workshop manager to the latest version.'); | ||
->setDescription('Update the workshop manager to the latest version.') | ||
->setHelp(<<<'EOF' | ||
Keeping the workshop manager up to date is just as important as updated the workshops themselves. | ||
<info>workshop-manager <comment>%command.name%</comment></info> | ||
You can then continue using the workshop manager as you were before. | ||
EOF | ||
); | ||
$application->command('rollback', SelfRollback::class) | ||
->setDescription('Rollback the workshop manager to the previous version.'); | ||
->setDescription('Rollback the workshop manager to the previous version.') | ||
->setHelp(<<<'EOF' | ||
Something go horribly wrong after that <comment>self-update</comment>? No worries this command got your back. | ||
<info>workshop-manager <comment>%command.name%</comment></info> | ||
You can then continue using the workshop manager as you were before. | ||
EOF | ||
); | ||
} | ||
|
||
$application->command('verify', VerifyInstall::class, ['validate']) | ||
->descriptions('Verify your installation is working correctly'); | ||
->descriptions('Verify your installation is working correctly')->setHelp(<<<'EOF' | ||
This command will help diagnose those issues and point you in the right direction. | ||
<info>workshop-manager <comment>%command.name%</comment></info> | ||
You might need to verify your installation if your running into problems. | ||
EOF | ||
); | ||
|
||
$application->setAutoExit(false); | ||
$application->setCatchExceptions(false); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as
an
argumentThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as all the other commands also